NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Nerdkit UART: 115200 --> 9600 baud rate

April 01, 2013
by oshjdf
oshjdf's Avatar

Line 15 in uart.c:

UBRR0L = 7; // for 115200bps with 14.7456MHz clock

How to set baud rate to 9600?

April 01, 2013
by pcbolt
pcbolt's Avatar

Hi oshjdf -

The formula for computing baud setting in normal operation mode is:

UBRR0L = (ClockFreq / (16 * BaudRate)) - 1

So for your example :

UBRR0L = (14745600 / (16*9600)) - 1 = 95
April 01, 2013
by oshjdf
oshjdf's Avatar

Thanks pcbolt.

Post a Reply

Please log in to post a reply.

Did you know that two resistors plus a transistor can be used to make a better voltage supply? Learn more...