Microcontroller (3) | Serial Interface

6. Serial Interface

Parallel Communication and Serial Communication

Microcontroller (3) | Serial Interface

Asynchronous and Synchronous Communication

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

Asynchronous Serial Full Duplex (P3.0-RXD P3.1-TXD)

Microcontroller (3) | Serial Interface

Timer 1 serves as the baud rate generator to control the rhythm of opening the door,

generating transmission and reception completion interrupts TI, RI

Microcontroller (3) | Serial Interface

Mode 0 is used for expanding IO, while Modes 1-2 are communication modes.

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

TB8 represents the stop bit for the data being sent, which is only useful during transmission, and is the RB8 of the receiver

RB8 is the stop bit for the received data, which is only useful during reception, and is the TB8 of the receiver

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

Serial port interrupts must be cleared by software

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

SMOD can be either 0 or 1

Microcontroller (3) | Serial Interface

Low bits come first, high bits come later

Microcontroller (3) | Serial Interface

All are sent out, MOV SUBF, A. sends data out, the serial port opens automatically. MOV A. SUBF, receives data in, the serial port opens automatically

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial InterfaceAll are received in, remember to configure scon

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

01

Microcontroller (3) | Serial Interface

Valid reception conditions:

Microcontroller (3) | Serial Interface

D8 stores the data sent from TB8, and the received D8 is stored in RB8

Key Point:

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

The second group R0 must set RS1=1, RS0=0.

Microcontroller (3) | Serial Interface

Initialization has been completed earlier, this is just a demonstration of the interrupt program

Microcontroller (3) | Serial Interface

P stores the parity of the data received as judged by the receiving microcontroller,

RB8 contains the ninth bit of the received data, which is written by the transmitter into the data to be sent in TB8

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial Interface

Example Problem:

Microcontroller (3) | Serial Interface

Microcontroller (3) | Serial InterfaceMicrocontroller (3) | Serial InterfaceMicrocontroller (3) | Serial InterfaceMicrocontroller (3) | Serial InterfaceMicrocontroller (3) | Serial InterfaceMicrocontroller (3) | Serial InterfaceMicrocontroller (3) | Serial InterfaceMicrocontroller (3) | Serial Interface

Leave a Comment