Baud rate calculation


Closed Thread
Results 1 to 13 of 13

Hybrid View

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

    Default

    nope i don't hate them... it's more a matter of updating it to fit with the EUSART.... as already asked a while back.

    Do you really need it as this fast is always my question

    I'll do the EUSART thing one day.

    For now, i'd modified the baud restriction. try it... use it to your own risk and all the usual disclaimer stuff. Didn't test it in real environement so, if it works, it works case not... too bad
    Attached Files Attached Files
    Last edited by mister_e; - 21st July 2006 at 21:08.
    Steve

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

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170

    Default

    Quote Originally Posted by mister_e
    ...Do you really need it as this fast is always my question...
    Well, I don't know exactly how fast I need it the USART to go. All I know is that it has to be fast enough so that I can transfer 2 bytes from the 16F to the 18F without losing the USB connection.

    I had some difficulty in coming up with a baud rate that was compatible between a 16F @ 20MHz and a 18F @ 48MHz. Since I can't change the FOSC for the 18F because of USB, I did the next best thing and adjusted the FOSC on the 16F. I used 16 MHz which is a multiple of 48, I figured I could come up with a compatible SPBRG value that way.

    Sure enough, SPBRG=0 @ 16 MHz and SPBRG=2 @ 48 MHz both give 1000 KBAUD. It's not the maximum of 1250, but it's close. Now I have to make some tests later and see if the USB connection holds up.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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

    Default

    use the calc and get the lower error % is one of the best trick i can say. Now uncheck the BRGH=1 box to compare both results. Sometime BRGH=1 give a better error % sometimes not. it's all depend of the OSC speed and the BRGH setting. This one of the reason i did this calc. Probably i could add an auto error % feature wich will compare both BRGH=1 and BRGH=0 results and give the best of it. As now it just provide the best error % for the BRGH you choose.

    Using your example, both gave 0% error percentage.. couldn't be better assuming a real 16MHZ and a real 48MHZ
    HTH
    Last edited by mister_e; - 21st July 2006 at 21:56.
    Steve

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

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170

    Default

    Thanks Steve, the new "improved" version works great!

    Robert
    Attached Images Attached Images  
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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

    Default

    How dare you edit the title bar? mon esti'd'chien sale LMAO!

    Great to know it's working
    Steve

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

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170

    Default

    Paint Brush is my friend.

    I was wondering if you'd notice.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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

    Default

    Hehe... yes i do
    Steve

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

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC 18f1220 EUSART Baud Rate Cache Problem
    By wklose99 in forum Off Topic
    Replies: 3
    Last Post: - 15th April 2008, 00:39
  3. Auto Baud Rate Detection
    By mytekcontrols in forum Serial
    Replies: 10
    Last Post: - 31st October 2005, 02:17
  4. PIC12F675, accuracy of baud rate with Internal Oscillator
    By Chris Mayhew in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st August 2005, 22:41
  5. Baud Rate and Timing Calculator
    By picnaut in forum General
    Replies: 3
    Last Post: - 23rd January 2004, 16:48

Members who have read this thread : 0

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