Implement UART serial communication experiment

1. UART Serial Port Profile  

  A serial interface is referred to as "Serial Interface", i.e., using the serial communication interfaces. Serial communication data into the form of a byte-by-bit transmission of data in a line, a communication line characterized by simple, but slow transfer speed.

Thus serial widely used for applications in the field of data transmission speed of less demanding embedded, industrial control. In this experiment we will use the UART serial complete FPGA development board PC and FPGA communication.

  Serial communication is divided into two modes: synchronous and asynchronous serial communications serial communication.

  Synchronous serial communication parties need to communicate under the control of the same clock, synchronous transmission data;

  Asynchronous serial communication means communicating parties using respective clock control data transmission and reception.

UART is an asynchronous serial communication is a universal asynchronous receiver transmitter (universal asynchronous receiver-transmitter), which converts parallel data into serial data to transmit, when receiving the received serial data when data is transmitted data is converted into parallel data.

UART serial communication requires two signal lines to implement, for a serial port, is responsible for an additional serial port to receive.

UART data in a transmission or reception by the four parts, a start bit, data bits, stop and parity bits as shown in position, as shown in FIG.

Wherein, marks the beginning of the start bit of a data, marking the end of a stop bit data, the data bits are valid data of one frame of data.

Parity bits are divided into odd and even parity for checking the data for errors during transmission.

Odd parity, the sender should be the number of data bits and 1 parity bit of the sum of the number of 1 is an odd number;

When the receiver receives the data, the number of 1 is checked, if it is odd, then the data goes wrong during transmission.

Similarly, even parity is checked whether the number of 1s is even.

 

Asynchronous serial communication data format 

UART data format and transmission rate during communication is set to the correct communication, sending and receiving sides, and should follow the same conventions set.

5,6,7,8-bit data bits to be selected, in which 8 data bits are the most commonly used, generally choose eight data bits in practical applications;

Alternatively odd parity check bit, no parity or even parity;

Alternatively one stop bit (default), 1.5 or 2.

Rate is represented by serial communication baud rate, which represents the number of bits of binary data per second, in units of bps (bits / sec), and baud rates have 9600,19200,38400,57600 115200 and the like.

After setting the data format and transmission rate, UART responsible for the completion string data and converts, by the transmitted signal to achieve an external driving circuit.

Transmission of electrical signals with different levels and standard interface specification, there RS232, RS422, RS485, etc. for standard asynchronous serial communication interfaces that define the electrical characteristics of different interfaces, such as RS232 input is single-ended output, and RS-422/485 is a differential input and output.

 

RS232 interface standard appeared earlier, the full duplex mode of operation, i.e. transmitting and receiving data may be performed simultaneously.

The transmission distance is short (less than 15m), RS232 serial communication is the most commonly used interface standards, for chapter describes the RS232 the UART serial communication standards.

The most common standard RS-232 serial interface to the DB9 to type, as shown by pattern, used in industrial control IPC are generally equipped with a plurality of serial ports, many older desktop computers are also equipped with a serial port.

But newer laptops and desktops that do not have serial ports, they are generally used to implement serial communication with external devices via USB to serial cable.

 

 

DB9 connector

 

 

 

USB serial cable

 

Description DB9 connector, and the pin function defined as shown below, we generally use wherein the 2 (RXD), 3 (TXD), 5 (GND) other pins are generally not used in the ordinary serial port mode, If you want to know, you can own Baidu next.

 

 

 

 

 

 

DB9 interface definition

2. Experimental task

  The host computer sends data through the serial port debugging assistant to the FPGA, and the FPGA receives the received serial data to the host computer via the data transmission, loopback complete serial data.

Guess you like

Origin www.cnblogs.com/ltybk/p/11541995.html