[ Log In ]
Serial to USB converter with Micro USB cable

USB to Serial Converter

Thumbnail: Crystal Oscillator 18.432 MHz for UART

18.432 MHz Crystal Oscillator 18pf 30ppm

Thumbnail: 22 pF Capacitor

22 pF Multilayer Ceramic Capacitor

Thumbnail: Quartz crystal oscillator - 16 MHz

16 MHz Crystal Oscillator 20 pF Through Hole

USB 2.0 Cable 10 Foot Type A Male to Type B Male

USB 2.0 Cable Type A Male to Type B Male - 10 FT

3 Foot USB Cable Type A to USB Cable Type A

USB Cable Type A Male to USB Type A Male - 3 FT

Tumbnail: 62 oz-in NEMA 17 Stepping motors (also called stepper motor)

NEMA 17 Stepping Motor (62 oz-in 5mm single shaft)

$19.95 Out of Stock
Image of the Atmega324p



10K timmer potentiometer

10K Trimmer Potentiometer (Through Hole)


Programming: Fixing the UART/USART Baud Rate Formula in the Library

The section of the UART/USART initialization for determining the baud rate had an error. The error pertained to first not containing the product of 16 and baud so the F_CPU is not divided by the 16 before the 16 is multiplied by the baud. The second problem was that the letter 'L' was not added after the 16. The L, in the C programming language informs the compiler that the 16 is a long integer.
uint16_t UBBRValue = lrint(( F_CPU / (16L * baud) ) - 1);

Comments and Additional Information

Have some code to share? Or additional information? Respond here:

You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.


Code (optional):