Serial port communication mode of 51 single chip microcomputer

Publisher:Jinyu521Latest update time:2017-10-14 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction: The serial port is a tool for the microcontroller to exchange information with the outside world.

There are two communication modes for 8051 microcontroller:


Parallel communication: data bits are sent or received at the same time. Serial communication: data bits are sent or received sequentially. See the figure below:


Click here to view the image in a new window



Serial communication method:


Asynchronous communication: It uses a start bit to indicate the beginning of a character and a stop bit to indicate the end of a character. The format of each frame is as follows:

In a frame format, there is a start bit 0 first, then 8 data bits, with the low bit first and the high bit last, followed by the parity bit (which can be omitted), and finally the stop bit 1. Using this format to represent characters, characters can be transmitted one by one.


In asynchronous communication, there must be two regulations between the CPU and the peripherals, namely, the character format and the baud rate. The character format is stipulated so that both parties can understand the same string of 0s and 1s as the same meaning. In principle, the character format can be freely determined by both parties in communication, but from the perspective of universality and convenience, it is generally better to use some standards, such as the ASCII standard.

Baud rate is the speed at which data is transmitted, and its definition is the number of bits of binary numbers transmitted per second. For example, if the data transmission rate is 120 characters/s, and each character contains 10 digits as specified above, the transmission baud rate is 1200 baud.


Synchronous communication: In synchronous communication, each character uses a start bit and a stop bit as a mark of the beginning and end of the character, which takes time; so when transferring data blocks, in order to increase the speed, these marks are often removed and synchronous transmission is used. Since the start of data block transfer must be indicated by a synchronization character, and a clock is required to achieve synchronization between the sender and the receiver, the hardware is more complex. 


Communication direction: In serial communication, the one-way transmission method in which the communication interface can only send or receive is called simplex transmission; and the two-way transmission of data between two machines A and B is called duplex transmission. Duplex transmission is divided into half-duplex transmission and full-duplex transmission. Half-duplex transmission means that the two machines cannot send and receive at the same time, and can only send or receive information at any time.


Reference address:Serial port communication mode of 51 single chip microcomputer

Previous article:Serial interface structure and working mode setting register of 8051 single chip microcomputer
Next article:Program to generate continuous rectangular pulses using MCU timer T0 and P1.7 port

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号