Asynchronous communication
The so-called asynchronous communication means that data is transmitted in characters. The transmission between characters is completely asynchronous, while the transmission between bits is basically synchronous.
The characteristics of asynchronous serial communication can be summarized as follows
1) Transmit information in characters
2) The interval between two adjacent characters is of any length
3) Because the bits in a character are limited in length, the required receiving clock and sending clock only need to be close.
4) The characteristics of asynchronous mode are: asynchronous between characters, synchronous within each character
Asynchronous serial data format
1) 1 start bit, defined as low level 0
2) 5 to 8 data bits, i.e. valid information to be transmitted
3) 1 parity bit
4) 1~2 stop bits, specified as high level 1
Synchronous Serial
The so-called synchronous communication means that data transmission is based on data blocks (a group of characters), and the characters and the bits within the characters are synchronized.
The characteristics of synchronous serial communication can be summarized as follows:
1) Transmit information in blocks
2) In a data block (information frame), there is no space between characters.
3) Because a transmitted data block contains a lot of data, the receiving clock and the sending clock are strictly synchronized, usually with a synchronous clock
Data format of synchronous serial mode
1) Two synchronization characters are used as the start mark of a data block (information frame).
2) n consecutively transmitted data
3) Two-byte cyclic redundancy check code (CRC)
example
1 #include "2410lib.h"
2
3 void uart0_test(void);
4
5
6
7 int main(int argc,char **argv)
8
9 {
10
11 sys_init();
12
13 uart_printf("n Embest Arm S3CEB2410 Evaluation Boardn");
14
15 while(1)
16
17 {
18
19 uart0_test();
20
twenty one }
twenty two
twenty three }
twenty four
25 void uart0_test()
26
27 {
28
29 char cInput[256];
30
31 UINT8T ucInNo=0;
32
33 char c;
34
35 uart_init(0,115200,0);
36
37 uart_printf("n UART0 Communication Test Examplen");
38
39 uart_printf("Please input words, then press Enter:n");
40
41 while(1)
42
43 {
44
45 c=uart_getch();
46
47 uart_printf("%c",c);
48
49 if(c!='r') //enter key
50
51 cInput[ucInNo++]=c;
52
53 else
54
55 {
56
57 cInput[ucInNo]='';
58
59 break;
60
61 }
62
63 }
64
65 delay(1000);
66
67 uart_printf("n The words that you input are: n %sn",cInput);
68
69 uart_printf(" end.n");
70
71 }
Previous article:【ARM】Timer
Next article:【ARM】2410 Bare Metal Series - Interrupt Processing
Recommended ReadingLatest update time:2024-11-16 12:58
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Uf2 Introduction
- Wi-Fi-7?
- Analog Series: RF: In the 5G Era, RF Front-End Shines
- FPGA Design Tips
- UDP packet loss problem
- Live broadcast data collection | ST home appliance three-phase motor control solution
- New generation of ESD protection devices no longer require VCC connection
- The latest MicroPython official PDF technical documentation (updated to v1.21)
- Technical applications of crystal oscillators and intelligent robots during the epidemic
- EEWORLD University ---- Gizwits ECE Getting Started Tutorial