PDA

View Full Version : USART SPBRG Calculator software



mister_e
- 6th June 2005, 10:09
Hi all,
i did a little utility for those who want to get the right SPBRG value in a snap. It also allow you to increase/decrease the value to get the best error percentage. Any comments are welcome.

Have fun!

Dave
- 6th June 2005, 13:06
mister e, It doesn't work very good..... Try 4433619 for oscillator freq & 9600 for baud, in low baud mode.

Dave Purola,
N8NTA

Luciano
- 6th June 2005, 14:15
Thank you for this tool!
See JPG attachment for my comments.

Luciano

Dave
- 6th June 2005, 15:20
I beleive the frequency should be entered in hertz, not megahertz and the baudrate should be displayed with 1 baud resolution not kilobaud.

Dave Purola,
N8NTA

mister_e
- 7th June 2005, 11:12
Here's the new version.


the baudrate should be displayed with 1 baud resolution not kilobaud.


It is !

Mike, K8LH
- 28th August 2005, 17:10
Mister_e,

A very nice applet Sir... May I ask if you have a newer version which supports both 8-bit SPBRG solutions and the newer 16-bit SPBRG solutions?

I created an Excel 2000 SPBRG Calculator spreadsheet, available on the Microchip Forums (forum.microchip.com/tm.asp?m=76411), which produces both 8-bit and 16-bit SPBRG solutions but a stand-alone applet like yours would be much better and a lot more convenient...

Thank you again for making your SPBRG Calculator available...

Regards, Mike

mister_e
- 28th August 2005, 17:23
You're welcome!

I wasn't aware of those 16 bits SPBRG... mmm interesting.

Can you tell me wich PIC have those 16 bits SPBRG?

EDIT: i found one in my new toy box... PIC18F2680. Should be enough to update the actual calc... once i'll be able to return home... %^&%! Mercedes...

Mike, K8LH
- 28th August 2005, 17:29
Hi again, and you're welcome -- it really is a nice app' (and I lack PC-side programming expertise)...

Some of the 'newer' devices have the 16-bit SPBRG capability as well as 8-bit SPBRG Compatible mode... Here are a few of them; 18F2420/4420, 18F2520/4520, and 18F2620/4620...

Regards, Mike

<added>

Gosh Steve, I didn't expect such a positive response and so quickly... Cool... Well, here's a 25-cent 'jump-start', if you haven't finished the new app' already (grin)...


Here is the 'base' SPBRG formula in the spreadsheet;

SPBRG = INT ( Fosc / BaudRate / Divisor - 1 )

where Divisor is equal to;

64 (BRGH=0 & BRG16=0) 8-bit SPBRG solution
16 (BRGH=1 & BRG16=0) 8-bit SPBRG solution

16 (BRGH=0 & BRG16=1) 16-bit SPBRG solution
4 (BRGH=1 & BRG16=1) 16-bit SPBRG solution