Detect baud rate


+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    San Antonio, Texas
    Posts
    9

    Default Detect baud rate

    I'm using usart on an 18f series chip and need a way to detect 3 baud rates 19.2, 57.6 and 115.2 . The problem is I can't just use the autobaud detect in the PIC because I have to use the string the comm. channel is sending and detect with that data. The data stream is delimited with hex 00 and the data can be 2 to 9 bytes between the delimiter hex 00. There is a keep alive string of hex 00, 255, 129, 00 every 1 second. Other than that the data is random length and spaced.

    I need to be able to connect the comm. cable in the middle of transmission and have it sync up.

    I'm thinking of using a timer and testing for the keep alive string and if it times out then switch to the next baud rate and reset timer and test again.

    Any suggestion on how to get the baud rate to sync as fast as possible would be greatly appreciated.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Dick,

    It may be possible to use a Timer or Pulsin to measure the pulse widths of the incomming data (before enabling the USART). If you sample several pulses and find the smallest one of the bunch, you should be able to calculate what the baud rate is.

    HTH,
       

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

Posting Permissions

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