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,929
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:

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,349
Reputation
4,692
Reaction score
2,275
Trophy points
1,413
Location
Southwest, USA
Activity points
62,377
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

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,929
Dear BigDog
Thanks for reply, I got the point
Can I have the theory behind above math ( links of web)
Thanks once again
 

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,929
Dear kak,
thanks for reply
I asked about mathematics sorry for your misunderstand
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
49,160
Helped
14,393
Reputation
29,050
Reaction score
13,144
Trophy points
1,393
Location
Bochum, Germany
Activity points
283,322
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

Top