115200 Baud to 9600 Baud Translator


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    ScottC's Avatar
    ScottC Guest


    Did you find this post helpful? Yes | No

    Default 9600 to 115200 Baud

    yes,

    I am still using 22.1184 XTAL. I undersatand what you are saying, from what info I gathered, this or 11.something, 1/2 of 22.1184, or an 18.432 xtal is what you want for error free reception. I am still new at this so I'm still in the learnig curve. But it makes sense what you are saying. I am going to try changing the SPBRG later in the program using DEFINE HSER_BAUD 9600, and DEFINE HSER_SPBRG 143 to change the valuse. I compiled it, have not tested yet, I'll get to in a bit see if that works. What do you think?

    Scott

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    With HSERIN/HSEROUT you can change the data-rate by writing directly to SPBRG.
    Code:
    Here:
        SPBRG = 129 ' 9600 @20MHz
        HSEROUT ["TEST AT 9600",13,10]
        PAUSE 10
        SPBRG = 64 ' 19200 @20MHz
        PAUSE 5000 ' Time to switch terminal program from 9600 to 19200
        HSEROUT ["TEST AT 19200",13,10]
        PAUSE 5000
        GOTO Here
    You can't change DEFINEs at run time, so just write to SPBRG directly if you want to change data-rates with HSEROUT/HSERIN.

    With DEBUG/DEBUGIN the data-rate & pins used are fixed, you can't change data-rates on the fly, and you'll want your osc frequency as close as possible to whatever you have it DEFINEed as.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    OK, think about it .... you're running your pic at 22.1184MHz, PBP thinks it's running at 20MHz. You'll actually run 22.1184/20=1.10592 times too fast. You need to lower your baudrate by this factor to get DEBUGIN to run at the correct speed. 9600/1.10592=8681 should do the trick.

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. Replies: 14
    Last Post: - 20th March 2008, 13:54
  3. pic18f4520 baud rate change to 115200
    By caltex88 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th September 2007, 08:41
  4. Auto Baud Rate Detection
    By mytekcontrols in forum Serial
    Replies: 10
    Last Post: - 31st October 2005, 02:17
  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