Programming: UART/USART Set up to Baud Rate for AVR Microcontroller
Share
The UART communicates at a agreed upon speed set by the baud rate. This baud rate must be set in both the transmitting and receiving microcontrollers to work.
//Set the UBBR value int UBBRValue = 25; /Put the upper part of the baud number here (bits 8 to 11) UBRR0H = (unsigned char) (UBBRValue >> 8); //Put the remaining part of the baud number here UBRR0L = (unsigned char) UBBRValue;