USART SPBRG Calculator software


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default USART SPBRG Calculator software

    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!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    mister e, It doesn't work very good..... Try 4433619 for oscillator freq & 9600 for baud, in low baud mode.

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Thank you for this tool!
    See JPG attachment for my comments.

    Luciano
    Attached Images Attached Images  
    Last edited by Luciano; - 6th June 2005 at 13:23.

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    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

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Here's the new version.

    Quote Originally Posted by Dave
    the baudrate should be displayed with 1 baud resolution not kilobaud.
    It is !
    Attached Files Attached Files
    Last edited by mister_e; - 7th June 2005 at 10:59.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    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

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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...
    Last edited by mister_e; - 28th August 2005 at 16:28.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    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)...

    Code:
    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
    Last edited by Mike, K8LH; - 28th August 2005 at 16:36.

Similar Threads

  1. byte Tx w/ USART 16f876a problem
    By GargamelDigi in forum mel PIC BASIC
    Replies: 2
    Last Post: - 15th July 2008, 05:50
  2. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  3. I ammm Looosssst (USART Help)
    By shawn in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th May 2006, 05:05
  4. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07
  5. Replies: 5
    Last Post: - 1st December 2004, 12:49

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts