Shop OBEX P1 Docs P2 Docs Learn Events
SEROUT CPmmand Sound PAL — Parallax Forums

SEROUT CPmmand Sound PAL

Chuck ThomasChuck Thomas Posts: 39
edited 2007-12-21 18:32 in BASIC Stamp
SEROUT iopin, reset, [noparse][[/noparse]0]········· page 4 of SoundPAL datasheet.

What is the [noparse][[/noparse]0] ? The write up seems to state 'Output 9 low bits at 1200 baud.
From the HELP file [noparse][[/noparse]0] seems to be the outputdata. Is this saying output the data as a 0?

SEROUT Tpin {\Fpin}, Baudmode, {Pace,} {Timeout, Tlabel,} [noparse][[/noparse]OutputData]

OutputData† is list of variables, constants, expressions and formatters that tells SEROUT how to format outgoing data. SEROUT can transmit individual or repeating bytes, convert values into decimal, hex or binary text representations, or transmit strings of bytes from variable arrays. These actions can be combined in any order in the OutputData list.

Chuck Thomas

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-20 23:46
    Chuck,

    The SoundPAL resets when its I/O pin is held low for a certain period of time. Sending a zero byte (a low startbit, plus eight more consecutive low bits) at a slow baud rate is just a convenient way to pulse the pin low and restore it to an input when finished (via the open baudmode setting).

    -Phil
  • Chuck ThomasChuck Thomas Posts: 39
    edited 2007-12-21 17:59
    Phil,

    If the [noparse][[/noparse]0] were changed to [noparse][[/noparse]1] would it then send out 9 high bits?

    Thank you,

    Chuck
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-21 18:32
    No. Since a 1 byte in binary is 00000001, and since serial output is sent least-significant bit first, it would send one low bit (the start bit), one high bit (the 1), followed by seven low bits (the 0000000), followed by a high bit (the stop bit). If you were to look at the signal with a scope though, you would not see any trailing high bits, since the default state of the line is high (called "marking" in serial I/O lingo; low is called "spacing").

    To transmit all high bits, you'd send $FF. But, again, it you looked at the signal with a scope, all you'd see is one low bit (the start bit), since the following high data bits and the stop bit are the same as the default marking state.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 12/21/2007 6:39:21 PM GMT
Sign In or Register to comment.