According to Atmel documentation UBRRnL and UBRRnH are USART Baud Rate Registers.
The UBRRnH contains the four most significant bits, and the UBRRnL contains the eight least significant bits of the USART baud rate.
As I see if your device has multiple USARTs for example USART0 and USART1 you can choose the one you need by modifying UBRRnL
and UBRRnH
(and maybe other registers too). Change the n
(in UBRRnL and UBRRnH) to the required USART id number and assign it to UBRRnL
and UBRRnH
.
For example in Assembly:
.equ USART = 1
.if USART == 0
.equ UBRRnH = UBRR0H
.equ UBRRnL = UBRR0L
.else
.equ UBRRnH = UBRR1H
.equ UBRRnL = UBRR1L
.endif
So when Assembly code is generated from the C source, the compiler might compile the UBRR0H
s and UBRR0L
s to UBRRnL
and UBRRnL
and define them as UBRR0H
and UBRR0L
, as Robert Harvey stated.