arm serial communication

Publisher:DreamySunsetLatest update time:2021-07-12 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 the asynchronous mode are: asynchronous between characters, and 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


#include "2410lib.h"


void uart0_test(void);


int main(int argc, char **argv)


{


   sys_init();


   uart_printf("n Embest Arm S3CEB2410 Evaluation Boardn");


while(1)


   {


       uart0_test();


   }        


}


void uart0_test()


{


char cInput[256];


   UINT8T ucInNo=0;


char c;


   uart_init(0,115200,0);


   uart_printf("n UART0 Communication Test Examplen");    


   uart_printf("Please input words, then press Enter:n");


while(1)


   {


       c=uart_getch();


       uart_printf("%c",c);


if(c!='r') //enter key


           cInput[ucInNo++]=c;


else


       {


           cInput[ucInNo]='';


break;


       }


   }


   delay(1000);    


   uart_printf("n The words that you input are: n %sn",cInput);      


   uart_printf(" end.n");  


}


Keywords:arm Reference address:arm serial communication

Previous article:Smart home appliance remote monitoring system based on CAN bus
Next article:S3c2440 bare metal realizes picture display

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号