I'm trying to work on UART for AVR. After setting the baud rate registers UBRRnX, I'm trying to configure the UCSRnA register.
I'm trying to set the 2nd bit, U2XO. Which is the right way to do it? UCSR0A = (1 << U2X0)
or
UCSR0A = UCSR0A | (1 << U2X0)
(Notice the OR operator in the 2nd statement)
No comments:
Post a Comment