Shop OBEX P1 Docs P2 Docs Learn Events
Baud Mode Calculation Query — Parallax Forums

Baud Mode Calculation Query

SandgroperSandgroper Posts: 62
edited 2008-06-21 18:35 in BASIC Stamp
Hi,

Can anyone explain what the "-20" is for in the following calculation?· This is taken from the SERIN command in the PBasic manual:

"Baudmode Calculation:
  1. Determine the bit period (bits 0 - 11)
    • BS2, BS2e, and BS2pe = INT(1,000,000 ÷ baud rate) - 20
    • BS2sx and BS2p = INT(2,500,000 ÷ baud rate) - 20
    • BS2px = INT(4,000,000 ÷ baud rate) - 20"

I'm using a BS2-e at 2400 baud for receiving a 10-bit frame (1 start bit, 8 data bits, no parity bit, 1 stop bit).· I understand how the baud mode of 396 is derived, but not what the " -20 " is for.· Is it purely to allow space for adjusting the bit rate up to 416 us?· Or is it to identify 8-N-1 to the BS2-e?· Or is it something else?

confused.gif·idea.gif

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2008-06-21 18:35
    Probably it represents some execution overhead. Typically such equations depend on the underlying "big-banging" code that implements the algorithm.
Sign In or Register to comment.