UART serial communication between two microcontrollers

Publisher:AmpouleLatest update time:2016-03-29 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
This is a very common form of configuration for communication between microcontrollers.
 


 
Many people are confused about how to connect RXD and TXD when the microcontroller communicates with a computer or chip. Because in some circuit diagrams, some are straight connection methods, and some are cross connection methods, which makes people a little confused. First of all
, we need to understand two concepts, namely DTE and DCE. DTE refers to data terminal equipment, and typical DTE is a computer and a microcontroller. DCE refers to data communication equipment, and a typical DCE is a MODEM. RXD and TXD in the RS232 serial port standard are both from the perspective of DTE, not DCE. After understanding this, the following wiring method will be easy to understand.
When the microcontroller communicates with the computer through the serial port, the RXD of the microcontroller is connected to the TXD of the computer, and the TXD of the microcontroller is connected to the RXD of the computer.
(1) Use a serial port straight-through cable. When designing the circuit, the RXD of the microcontroller is connected to the TXD of the circuit board DB9, and the TXD of the microcontroller is connected to the RXD of the circuit board DB9. The specific implementation can be reversed at the 232 level conversion chip.
(2) Use a serial port crossover cable. When designing the circuit, because the serial port line has been crossed, the RXD of the microcontroller is connected to the RXD of the circuit board DB9, and the TXD of the microcontroller is connected to the TXD of the circuit board DB9. They can be directly connected.
This can explain why some circuits use the direct connection method and some circuits use the cross connection method, because the serial port lines used are different.
--------------------------------------------------------------------------------------------------------------------------------------------
Therefore, when two microcontrollers communicate, the RxD (TxD) of one microcontroller should be connected to the TxD (RxD) of the other microcontroller.
Keywords:MCU Reference address:UART serial communication between two microcontrollers

Previous article:MCU controlled 220VAC disconnection
Next article:A Brief Discussion on the Application Program Architecture of Single Chip Microcomputer

Latest Microcontroller Articles
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号