Maximum Baud Rate at 4Mhz


Closed Thread
Results 1 to 8 of 8
  1. #1
    barkerben's Avatar
    barkerben Guest

    Default Maximum Baud Rate at 4Mhz

    Hi,

    I've been looking at the manual, and it states that to receive data at 9600 baud, a faster XTAL than 4Mhz MAY be required. I was wondering if anyone out there could help qualify that "may" for me?

    I am planning on using SERIN2 to listen to a serial bus at 9600baud, read an NMEA sentance, then parse it. I've been planning on using software serial routinesa as it seems to make parsing a string easier. My PIC currently uses a 4Mhz XTAl - any thoughts?

  2. #2
    Join Date
    Aug 2005
    Location
    Denver
    Posts
    25


    Did you find this post helpful? Yes | No

    Default May be required?

    In my experience, the combination of 4 Mhz and 9600 baud has never worked. It might have worked for other people. Since xtals are something like $.30 from Jameco, why take the chance?

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


    Did you find this post helpful? Yes | No

    Default

    For serious serial communication i will always suggest to use the PIC USART and use the SPBRG calc i did... few times ago http://www.picbasic.co.uk/forum/atta...6&d=1118138371
    @4mhz, you can have 9600 Bauds with 0.16% error.. quite good

    Another idea, If your PIC don't have a USART and you can live with DEBUG limitations, that's a great way to have higher baudrate speed even with a 4 MHZ crystal. It support the same modifier than SERIN2/SEROUT2.
    Steve

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

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I have found that SERIN2/SEROUT2 works fine at 9600 baud. I am using the internal 4Mhz oscillator (and a calibration routine). So if you are using an XTAL, I'm sure it will work.

    I'm using a 16F676.

  5. #5
    barkerben's Avatar
    barkerben Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for all the responses. I was interested in mister_e's suggestion of using DEBUG or DEBUGIN. He mentions limitations, but if they take the same mofifiers as serin/out2, then I wonder what these could be?

    Also, why is it able to run more quickly? It must have something to do with the overhead going on in the background with the different commands...?

    I've just been sitting down trying to write a parser for NMEA data to read in at 9600. Its all CSV, but annoyingly some of the fields are of varying length, making parsing a pain. I can tell the PIC to read a string until a certain charatcter is reached, or to read in x bytes and interpret as a number, but I cna't tell it to read in bytes until a certain character is reached (i.e a comma) then interperet as a number. I could probably read in as a string, then convert though...

    Oh well, will get there at some point :-)

    Cheers,

    Ben

  6. #6
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    I am right this minute using a 'F877 at 9600. I am reading 14 bytes with errors on the last 4 eceived. So I would have to say that I will need to go up to a 8MHz xtal. Just a bit too "iffy" at 4MHz.
    I might try the DEBUGIN as mentioned above and see what difference that makes. Stay tuned.
    .
    .
    .
    .
    Hmm...Nope, still the same. Gunna hafta get a faster xtal next time I'm up town..
    Oh Well....
    Last edited by muddy0409; - 7th November 2005 at 02:14.

  7. #7
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Well, fancy that!!
    After a bit of jiggery pokery with the decoding of the input array, it is working PERFECTLY with the DEBUGIN command. Very Pleased.

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Some issues with DEBUGIN is that I believe that you can only use receive information on the pin that is defined at the beginning of the program and whatever baud rate you choose to DEFINE can not be changed in the program.

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. Maximum Baud Rate error tolerance
    By keithdoxey in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th February 2007, 11:10
  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 : 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