Serout Timing Details

ArchiverArchiver Posts: 46,084
edited 2000-03-17 - 17:06:00 in Microcontrollers
Here is the situation, I am sending out two bytes of data at 2400 baud with
an inverted signal with a Stamp 2. The command below:

serout 7,396+$4000,[noparse][[/noparse]byte1,byte2]

I am receiving this data with a PIC.

My question is: What is the actual time lag between when the stop bit is
transmitted from byte1 and the start bit of byte2.

I have discovered, the hard way, that there is a time lag between the two
bytes of data.

Also, in the stamp manual it has the formula of INT(1,000,000/baud)-20 for
setting the stamp's transfer rate. What does the '-20' do?

One more question, is the same time lag between the two bytes of data the
same for a stamp1 and serin commands?

For those who will ask this question, I am programming a PIC for dedicated
PWM control of DC motors. The PIC will output a steady PWM signal, and will
only change when it is instructed from a serial input. The serial data has
direction and/or duty cycle. It is a 4 MHz PIC

All I am interested is in the timing lag between the bytes, not programming
techniques for the PIC.

Any info would be appreciated.

Pete Miles
petem@w...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-03-17 - 17:06:00
    > My question is: What is the actual time lag between
    > when the stop bit is transmitted from byte1 and the
    > start bit of byte2.

    Hi Pete,

    There is info on nitty gritty details of timing of SEROUT and SERIN on my
    web page at
    http://www.emesystems.com/BS2misc.htm#sertime
    In direct answer to your question, it amounts to 2.5 to 4.5 stop bits (250
    to 450 microseconds) at 9600 baud, depending on the exact form of the
    SEROUT command. The actual time is constant, e.g., at 50kbaud it is amounts
    to an extra 7 to 18 stop bits. At 2400 baud, the extra 150 to 350
    microseconds is only a fraction of a stop bit.

    -- Tracy Allen
    Electronically Monitored Ecosystems
    http://www.emesystems.com
Sign In or Register to comment.