UBRR: USART Baud Rate Register

logistic_guy

Senior Member
Joined
Apr 17, 2024
Messages
1,549
here is the question

Find the UBRR for the following baud rates (in both decimal and hex) if XTAL =16\displaystyle = 16 MHz and U2\displaystyle 2X =0\displaystyle = 0.

(a) 9600
(b) 19200
(c) 38400
(d) 57600

my attemb
it's easy to find the UBRR because there's formula
UBRR=XTAL16×BR1=1600000016×96001=10000961\displaystyle UBRR = \frac{XTAL}{16\times BR} - 1 = \frac{16000000}{16 \times 9600} - 1= \frac{10000}{96} - 1

=103.2\displaystyle = 103.2

how to convert this to hexadecimal and what's the difference between U2\displaystyle 2X =0\displaystyle = 0 and U2\displaystyle 2X =1\displaystyle = 1?
it ask me same question with U2\displaystyle 2X =1\displaystyle = 1☹️
 
Top