Spread the love
- Following are the registers used in programming of serial communication
USART DATA REGISTER (UDR)
- Used to hold byte of data that is being received or transmitted.
USART BAUD RATE REGISTER (UBRR)
- Used to set baud rate
USART CONTROL STATUS REGISTER A(UCSRA)
- RXC = 1 mean receive complete, 0 mean receive continue
- TXC = 1 mean transmission complete, 0 mean transmission continue
- UDRE = USART data register empty is 1 mean transmission complete, 0 mean transmission continue
- FE = frame error if this bit is 1
- DOR =data over run if this bit is 1
- PE = parity error if this bit is 1
- U2X = double baud rate if this bit is 1
- MPCM = multi processor communication mode
USART CONTROL STATUS REGISTER B(UCSRB)
- RXCIE = Receive complete interrupt enable bit is 1, to enable interrupt on RXC flag of UCSRA
- TXCIE = Transmission complete interrupt enable bit is 1, to enable interrupt on TXC flag of UCSRA
- UDRIE = USART data register empty interrupt enable bit is 1, to enable interrupt on UDRE flag of UCSRA
- RXEN = Receive enable if this bit is 1
- TXEN = transmission enable if this bit is 1
- UCSZ2 = combine with UCSZ1 and UCSZ0 to decide fram bit size.
- RXB8 & TXB8 is used in 9 bit frame (used earlier)
USART CONTROL STATUS REGISTER C(UCSRC)
- URSEL = use to access UCSRC or UBRRH
- UMSEL = USART mode select, 1 mean synchronous and 0 mean asynchronous
|
- USBS = stop bit select 0 mean single stop bit and 1 mean double stop bit
|
- UCPOL = clock polarity