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:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    Speed Controller for brushed electric motors
    20W Class-A Amplifier
    Pick
    freeze protector circuit
    tone control circuit designed
    servo tester
    500W Low Cost 12V to 220V Inverter
    Crystal Oscillator
    cascading shift registers to drive 7-segment displays with PC input
    single-813 crystal oscillator transmitter
    Door Knob Touch Alarm



    Top