Serial port communication

1.

  SCON Serial Port Register

    SM0 SM1 SM2 REN TB8 RB8 TI RI

2.

  Serial port working steps

  a. Determine how T1 works (program TMOD settings)

  b. Set the initial value of TH1 TL1

  c. Set the magnification value of SMOD. Because SMOD is in the PCON register, it is necessary to directly set the PCON in hexadecimal

  d. Start T1 with TR1 = 1

  e. Determine the serial port control (program the SCON register)

  When the serial port works in the interrupt mode, the interrupt setting (IE, IP register) must be performed.

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325063610&siteId=291194637