Research: Determine the UBBR Value to Get the Correct Baud Rate

The UBBR value is used to set the AVR Microcontroiller for the correct baud rate.



Formula: UBBR = ( (regular microcontroller clock speed) / 16 * (desired baud rate) ) - 1 Example: UBBR = (1,000,000 / 16 * 2400) - 1 = (1,000,000 / 38,400) - 1 = 26.0416667 - 1 = 25.0416667 The number that would be used for the UBBR value is 25 since it only accepts integer.
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.