| Electronic Components Datasheet Search |
|
AS8218 Datasheet(PDF) 112 Page - ams AG |
|
|
|||||||||||||||||||||||||||||
AS8218 Datasheet(HTML) 112 Page - ams AG |
|
112 / 123 page ![]() Data Sheet AS8218 / AS8228 Revision 3.0, 31-May-06 Page 112 of 123 If this condition is true, then all eight data bits are transferred to ReceiveSBUF, the ninth data bit is transferred to SCON.RB8, and SCON.RI is set to ‘1’. Otherwise all the received data is discarded and the receiver waits for the next falling edge on RxD. Assembler Code The following code fragments demonstrate the programming of the UART1. Adjusting the Baudrate (for all modes) SBL equ 9AH ; Serial BaudrateReload LowByte SBH equ 9BH ; Serial BaudrateReload HighByte mov SBL,#38 ; 9600 baud, 6MHz mov SBH,#0 Using Mode 0 mov SCON,#00H ; mode 0, REN=0, RI=0, TI=0 mov A,#53H clr TI ; clear transmit flag mov SBUF,A ; transmit 53H in mode 0 wait: jnb TI,wait ; wait until data is sent mov SCON,#10H ; mode 0, REN=1 - start reception clr REN ; REN=0 wait: jnb RI,wait ; wait until data is received mov A,SBUF ; move received byte into the accu Transmitting in Mode 0 mov SCON,#50H ; mode 1, REN=1, RI=0, TI=0 mov A,#53H clr TI ; clear transmit flag mov SBUF,A ; transmit 53H in mode 1 wait: jnb TI,wait ; wait until data is sent Receiving in Mode 1 (only bytes with valid stop bit) mov SCON,#70H ; mode 1, SM2=1, REN=1, RI=0, TI=0 wait: jnb RI,wait ; wait until data is received clr RI ; enable another reception mov A,SBUF ; move received byte to accu Transmitting in Mode 2 (ninth data bit as parity bit) mov A,#0A4h ; move data to accu mov C,P ; parity information to carry flag mov TB8,C ; parity information to ninth data bit mov SBUF,A ; transmit A4H in mode 2 wait: jnb TI,wait ; wait until data is sent Interrupt Based Receiving org 0h ; reset vector |
|
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 |