Auto Baud Rate with PIC18F2455

Posted on Aug 16, 2012

Most of the newer PIC come with the EUSART module which have the function for auto baud rate detection. The features allow a person to set the baud rate at runtime by sending the character `U` or 0x55 to the PIC. With ABDEN (auto baud rate enable) bit set and using BRG clock as a reference, each rising edge occurring on the RX pin is taken as a reference to calculate the SPBRG and SPBRGH value. After the Baud rate is set, the RCIF flag will be set. The receive register must be discarded as it doesn't contain meaningful data. The Image (PIC18F2455 datasheet, page 252) below shows the timing diagram for auto baud rate setup.

Auto Baud Rate with PIC18F2455
Click here to download the full size of the above Circuit.

A circuit based similar to the UART test is used to demonstrate the capability of auto baud rate generation.Using the code in the project file attached, It will 1st wait for a character "U" to be send over for baud rate calculation. Auto baud is enable using the 3 lines of code below. The UARTReadByte() will read and discard the byte after a successful configuration of baud rate. The LCD display will be the same as the image below after a successful program of the microcontroller. It is currently waiting for the character U to set the baud rate.

Leave Comment

characters left:

New Circuits



Popular Circuits

Composite Video titling Generator
Lantern with dimmer and flasher
Solid State Latching Relay Circuit
Electronic Horn
Frequency Modulator and Tuning Circuit
ham radio circuit audio filter
short circuit protection for balanced
UPS For Cordless Telephones
ir sensor
ultrasonic transmitter
SN75064 ~ SN75067 current Darlington circuit diagram of a switch
NE5532 manufactured by headphone amplifier circuit
SR63 holiday lights ASIC