Maximum Baud Rate error tolerance


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2003
    Posts
    432

    Default Maximum Baud Rate error tolerance

    Hi All,

    Several of the posts here recently have been about problems recieving or transmitting serial data.

    I was wondering what the maximum allowable error is to still retain reliable communications. I realise that this is probably a similar question to "how long is a piece of string" but I have been thinking about this quite a bit and playing with Mister_Es superb little utility.

    I currently have a project with several pics receiving IR data and forming messages to be sent to the main processor. The IR receiver PICs are 16F88s running at 4Mhz and the main CPU is an 18F452 running at 20MHz. Comms are at 9600 at the moment although I may speed this up once I have everything working OK.

    It occurs to me that the actual error is not the overall consideration but the difference between the error rates.

    e.g. if both PICs are running with an error of +8.5% then the difference is zero so comms should be perfect but if the two devices have different error rates then the situation could be totally different.

    If device A was +8.5% but device B was -1.5% then overall the discrepancy is 10%.

    How far out of sync can the two devices be before the error is too great ?

    Thanks
    Keith

    www.diyha.co.uk
    www.kat5.tv

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


    Did you find this post helpful? Yes | No

    Default

    depending of the baudrate i guess. But to me bellow 1-2 % is good.

    You could even use a Synchronous serial comm to make it 100% (hum hum) reliable... but the down side is that it use more i/o.

    I2C in slave/master is popular now..

    Anyways, why don't use the same crystal speed (appart of the PSU current, EMI etc)?
    Steve

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

  3. #3
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    depending of the baudrate i guess. But to me bellow 1-2 % is good.
    Thats what I figured.

    You could even use a Synchronous serial comm to make it 100% (hum hum) reliable... but the down side is that it use more i/o.
    Cant do that because I am already using all the pins on the 452. Some are shared for LCD/Databus. Also the serial port on the 452 is shared amongst several input streams.

    Anyways, why don't use the same crystal speed (appart of the PSU current, EMI etc)?
    I may well do in this instance for the comms described above but some devices that this will communicate with are already in use and run at 4MHz 9600 baud but messages are very short, typically a single byte.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  4. #4
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Smile

    ...in the good old days, a UART (8250) uses a clock of 16-times (?) the baudrate. So ist can sample the signal feg. at the middle of die time.

    What is about saying:
    1/8 of a bit jitter in 10 bits ? (8N1)
    It would be 1,25% error.

    I think it belongs to the intelligence (!) of the receiver to take the best samplepoints inside a serial character.

    Modern PICs are able to get very close baudrate by using higher frequencies and bigger dividers.

    If you are using an PIC-PIC-conversion, you are able to define your own baudrate by using "good" dividers of a standard frequency.
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

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


    Did you find this post helpful? Yes | No

    Default

    Hi Keith,

    Use a baud rate friendly crystal. (0% baud rate error).

    18.432 MHz for the 18F452 and 3.6864 MHz for the 16F88s.
    Does your compiler support these oscillator frequencies?

    Best regards,

    Luciano

    * * *

    Baud rate friendly crystals:

    1.8432 MHz
    3.6864 MHz
    7.3728 MHz
    11.0592 MHz
    14.7456 MHz
    18.4320 MHz

  6. #6
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Luciano View Post
    Use a baud rate friendly crystal. (0% baud rate error).

    18.432 MHz for the 18F452 and 3.6864 MHz for the 16F88s.
    Does your compiler support these oscillator frequencies?

    Baud rate friendly crystals:

    1.8432 MHz
    3.6864 MHz
    7.3728 MHz
    11.0592 MHz
    14.7456 MHz
    18.4320 MHz
    Hi Luciano,

    According to the PBP manual the only supported frequencies are
    Oscillator speed in MHz: 3(3.58) 4 8 10 12 16 20 24 25 32 33 40 so any timing function would be off. I could compensate for this but it would make my IR timing routines more complicated.

    As I said at the start, if BOTH PICs are off by the same amount then it wouldnt matter if it was 50% as they would be running at the same speed.

    My question was more out of curiosity as to how far out you could get before comms would be unreliable.

    Thanks to everyone for the replies
    Keith

    www.diyha.co.uk
    www.kat5.tv

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 at 4Mhz
    By barkerben in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th November 2005, 16:47
  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