【ARM】Serial communication

Publisher:BeaLaity0170Latest update time:2020-01-23 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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 }

Keywords:ARM Reference address:【ARM】Serial communication

Previous article:【ARM】Timer
Next article:【ARM】2410 Bare Metal Series - Interrupt Processing

Recommended ReadingLatest update time:2024-11-16 12:58

GlobalFoundries: Developed 3D Arm chips with 12nm FinFET packaging
According to a report by foreign media Tom's Hardware on August 10, GlobalFoundries announced this week that it has successfully produced a high-performance 3D Arm chip using its 12nm FinFET process. "These high-density 3D chips will bring new levels of performance and energy efficiency to computing applications suc
[Mobile phone portable]
ARM assembler under LINUX
1. Set up the GNU compilation environment Unzip the compilation tool and add it to the environment variable PATH 2. Use of compilation related commands Compile command arm-linux-gcc -g -c -o led.o main.o led.c main.c //Understand the usage of static compilation and compile without linking L
[Microcontroller]
ARM processor ~ interrupts and exceptions
Interrupts and exceptions definition Except for User and System, all working modes in ARM are exception modes. The exceptions here are broad and include the following three situations: External Interrupt (External Interrupt) Changing the program execution flow due to reasons external to the CPU is an asynchronous ev
[Microcontroller]
ARM processor ~ interrupts and exceptions
Design and implementation of a color TFT-LCD module based on ARM9
1 Introduction TFT-LCD has been widely used in image display systems because of its thin thickness and excellent picture quality, which can realize high-speed, high-brightness and high-contrast display of information. Although TFT-LCD has good display performance, the driving signal of TFT-LCD is very complex, and t
[Microcontroller]
Design and implementation of a color TFT-LCD module based on ARM9
ARM processor and ARM processor working mode
Introduction: ARM microprocessors generally have two working states and can switch between the two states: the first is the ARM state, in which the processor executes 32-bit word-aligned ARM instructions; the second is the Thumb state, in which the processor executes 16-bit, half-word-aligned Thumb instructions. ARM
[Microcontroller]
ARM processor exception handling steps
Introduction: The processor allows multiple exceptions to occur simultaneously, and they will be processed according to a fixed priority. When an exception occurs, the ARM microprocessor will perform the following steps: ARM processor status, instruction set ARM microprocessors generally have two working states and
[Microcontroller]
openocd command line programming ARM bare metal program problems and solutions
Abstract: In the past, I used RVDS IDE to burn and debug ARM programs. Although RVDS is an integrated debugging tool that is convenient to debug, sometimes I only know one thing and not the other. I only know to click buttons step by step, ignoring some essential things. And another disadvantage of RVDS is that it can
[Microcontroller]
openocd command line programming ARM bare metal program problems and solutions
Introduction to ARM single-chip system features and embedded applications
1. Functional block diagram and functional block description EP7209 is the world's first digital audio decoder system-on-chip that supports both the popular MP3 standard and rapidly emerging Internet audio compression standards such as Microsoft Audio. Figure 1 is a functional block diagram of EP7209. As ca
[Microcontroller]
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号