| Electronic Components Datasheet Search |
|
SN8F5708 Datasheet(PDF) 142 Page - SONiX Technology Company |
|
|
|||||||||||||||||||||||||||||
SN8F5708 Datasheet(HTML) 142 Page - SONiX Technology Company |
|
142 / 204 page ![]() www.sonix.com.tw SN8F5708 Series Copyright © 2019, SONiX Technology Co., Ltd. UART Datasheet Rev. 2.4 142 20.9 Sample Code The following sample code demonstrates how to perform UART mode 1 with interrupt. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #define SYSUartSM0 (0 << 6) #define SYSUartSM1 (1 << 6) #define SYSUartSM2 (2 << 6) #define SYSUartSM3 (3 << 6) #define SYSUartREN (1 << 4) #define SYSUartSMOD (1 << 7) #define SYSUartES0 (1 << 4) void SYSUartInit(void) { // set UTX, URX pins’ mode at here or at GPIO initialization P05 = 1; P0M = P0M | 0x20 & ~0x40; // configure UART mode between SM0 and SM3, enable URX S0CON = SYSUartSM1 | SYSUartREN; // configure UART baud rate PCON = SYSUartSMODE1; S0CON2 = SYSUartBD1; S0RELH = 0x03; S0RELL = 0xFE; // enable UART interrupt IEN0 |= SYSUartES0; // send first UTX data S0BUF = uartTxBuf; } void SYSUartInterrupt(void) interrupt ISRUart { if (TI0 == 1) { S0BUF = uartTxBuf; TI0 = 0; } else if (RI0 == 1) { uartRxBuf = S0BUF; RI0 = 0; } } |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |