1. Introduction
UART, Universal asynchronous Receiver-transmitter, universal asynchronous transceiver transmitter
The UART agreement provides for compliance by both parties to the communication, which belongs to the data link layer
The RS232 interface standard specifies electrical characteristics, logic levels, and various signal line functions, which belong to the physical layer
2. RS232
The RS232 interface is a standard serial interface on the PC, with DB9 and DB25 of two, typically DB9
Its interface is defined as follows
RS-232 the equipment into
-Data Terminal equipment (dte,data Terminal equipment, for example, PC)
-Data communication equipment (Dce,data communication equipment)
DB9 and male (needle type) and female (hole type) of the points, the PC is male
The actual use of interfaces, generally as long as the 2,3,5, that is, receive, send and ground three lines, you can achieve communication 3. Uart
The UART transmits the data in a bit order with a transmission line, with the character for the transmission unit
The time interval between two characters in the communication is not fixed, but the time interval between the two adjacent bits in the same character is fixed.
Data transfer rate is expressed as a baud rate , the number of times a carrier parameter has changed within a unit time, or the number of bits transmitted per second
If 240 characters are transmitted per second, and each character contains 10 bits (one starting bit, 1 stop bit, 8 data bits), then the baud rate is 2400Bd
Transmission timings such as
In the UART, there are two states on the signal line, which are distinguished by logic 1 (high) and logic 0 (Low level), respectively.
When idle, the data cable should remain in the logic high state
The meaning of these members is as follows
starting bit (Start Bit): A logic 0 signal is first emitted, indicating the start of the transmission character
Data bits (Data bits): Can be 5~8 bit logic 0 or 1. such as ASCII code (7-bit), extended BCD (8-bit) small-end transmission
Check digit (Parity bit): After the data bit plus this bit, so that 1 of the number of digits should be even (even) or odd (odd check)
Stop Bit (Stop Bit): It is the end of a character data flag. Can be 1-bit, 1.5-bit, 2-bit high-level
idle bit : in the logical 1 state, indicates that there is no data transfer 4 on the current line. Connection
The connection between the PC and the embedded device requires a level shifter (max232/max3232),
Specifically, the embedded device leads the UART port to RS-232 Connector (4 port, TX, RX, GND, VCC)
RS232 connector connected through the DuPont line MAX232
The MAX232 is connected to the COM port/usb port of the PC via the RS232 interface/usb
Tip: If you use a PC USB interface to do the serial port requires a dedicated driver 5. UART instances in Linux
Hello World
Information:
<serial Port basics>
<uart Tutorial for Robotics>
<a tutorial on the RS-232 standard>
UART Interface Introduction