Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Microchips Reference manual calculated Desired Baud Rate

Status
Not open for further replies.

PA3040

Advanced Member level 3
Joined
Aug 1, 2011
Messages
883
Helped
43
Reputation
88
Reaction score
43
Trophy points
1,308
Activity points
6,936
Dear All
Please see two image. one I calculated desired Baud Rate result and other
as per Manual The result of X is 25.042 and my calculation is 26.041
please advice wrong in my side
MCU is 16f877a USART


dbr.jpgDBR1.png
 
Last edited:

The equation shown in the second photo:

For BRGH = 0;

BAUD = Fosc/(64*(SPBRG + 1))

equates to:

SPBRG = (Fosc/(64*BAUD)) - 1

Which for BAUD = 9600 and Fosc = 16MHz calculates a SPBRG = 25.042.

Your version of the equation is missing the "1" subtracted from the the right hand side of the equation.

The actual BAUD rate generated is 9,615.38 and BAUD rate error is -0.2%.


BigDog
 
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear BigDog
Thanks for reply, I got the point
Can I have the theory behind above math ( links of web)
Thanks once again
 

Dear kak,
thanks for reply
I asked about mathematics sorry for your misunderstand
 

Can I have the theory behind above math ( links of web)
Which theory are you looking for?

- fosc divided by 4 makes fcy (instruction cycle frequency)
- fcy divided by (SPBRG+1) makes BCLK
- BCLK divided by an oversampling factor of 16 makes the actual baud rate

I asked about mathematics sorry for your misunderstand
The data sheet linked by kak111 is explaining the baud generator "mathematics" in detail. Just read it...
 
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top