Traditional Culture Encyclopedia - Photography major - SCON = 0x 52; What the hell does that mean?

SCON = 0x 52; What the hell does that mean?

Hello, landlord. SCON is a serial port control register of single chip microcomputer, and it is a macro variable that can be directly addressed. What the landlord wants to ask is what do you mean by giving it 0x52? The binary represented by 0x52 is 0 1 1000 10, and each symbol means: (high bit in front, position in back) SM0, SM 1: serial port working mode selection bit.

SM2: Multi-machine communication control bit

REN: Control bit that allows/prohibits serial port reception.

TB8: In mode 2 and mode 3, it is the 9th bit data to be sent, which can be set to 1 or cleared by software as required, or it can be used as a parity bit, and it is a stop bit in mode 1.

RB8: In mode 2 and mode 3, it is the received 9th bit data (starting from the 8th bit of TB8); In mode 1, RB8 receives the stop bit, which is not used in mode 0.

Ti flag bit of serial port sending interrupt request

After sending a frame of serial data, the hardware is set to1; Cleared by the software after switching to the interrupt service program.

Ri flag bit of serial port receiving interrupt request