chap10 - Chapter 10 8051 Serial Communication 1 Objective...

This preview shows page 1 - 14 out of 93 pages.

1 Chapter 10 8051 Serial Communication
2 Objective 8051 can provide a serial communication function and allow the programmer to transmit or receive the external information bit by bit for each time Due to IBM PC communicates frequently with 8051, therefore we stress on the communications between 8051 and the COM port of PC by using RS232. To understand the characteristics of serial communication, the specifications of RS232C and MAX232 IC (level conversion) 。 To understand the functions of specific registers of 8051 and learn how to write 8051serial communication program.
3 Sections 10.1 Basics of serial communication 10.2 8051 connection to RS232 10.3 8051 serial communication programming
4 Section 10.1 Basics of Serial Communication
5 8051 and PC The 8051 module connects to PC by using RS232. RS232 is a protocol which supports half-duplex, synchronous/asynchronous, serial communication. We discuss these terms in following sections. PC 8051 COM 1 port RS232 MAX232 UART
6 Simplex vs. Duplex Transmission Simplex transmission: the data can sent in one direction. Example: the computer only sends data to the printer. Duplex transmission: the data can be transmitted and receive Transmitter Receiver Transmitter Receiver Receiver Transmitter
7 Half vs. Full Duplex Half duplex: if the data is transmitted one way at a time. Full duplex: if the data can go both ways at the same time. Two wire conductors for the data lines. Transmitter Receiver Receiver Transmitter Transmitter Receiver Receiver Transmitter
8 Figure 10-2. Simplex, Half-, and Full- Duplex Transfers Half Duplex Full Duplex Transmitter Receiver Transmitter Receiver Receiver Transmitter Receiver Transmitter
9 Parallel vs. Serial Computers transfer data in two ways: Parallel data is sent a byte or more a time (fast) Only short distance between two systems The 8-bit data path is expensive Example: printer, hard disks Serial The data is sent one bit at a time (slow) Long distance (rarely distortion) cheap The data can be transferred on the telephone line (by using modem.)
10 Figure 10-1. Serial versus Parallel Data Transfer (1/2) Sender Receiver Sender Receiver Serial Transfer Parallel Transfer D0 D7
11 Figure 10-1. Serial versus Parallel Data Transfer (2/2) Sender Receiver Sender Receiver Serial Transfer Parallel Transfer D0-D7 D0 Other control lines Other control lines
12 Serial Communication How to transfer data? Sender: The byte of data must be converted to serial bits using a parallel-in-serial-out shift register. The bit is transmitted over a single data line. Receiver The receiver must be a serial-in-parallel-out shift register to receive the serial data and pack them into a byte. 111 01000001 011 ‘A’ register 8-bit character register 8 1 parallel-in serial-out serial-in parallel-out
13 Asynchronous vs. Synchronous Serial communication uses two methods: In synchronous communication, data is sent in blocks of bytes.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture