Shop OBEX P1 Docs P2 Docs Learn Events
Electrical Signal — Parallax Forums

Electrical Signal

leshea2leshea2 Posts: 83
edited 2005-09-24 23:47 in BASIC Stamp
If I used this code to send this SEROUT command to an electrical device, like an automatic dialing system, would this code send this SEROUT command as an electrical signal that told the dialing system to dale (18004459889 at 4:35 p.m.), or would the numbers and letters in this SEROUT command just be displayed as a message on the dialing systems LCD ?

Thanks !



' {$STAMP BS2sx}
' {$PBASIC 2.5}

Sout PIN 0
Baud CON 17405
eePntr VAR Word
char VAR Byte

Msg1 DATA "Call 18004459889 at 4:35 p.m.", 0

Main:
eePntr = Msg1
GOSUB Send_Msg
END

Send_Msg:
DO
READ eePntr, char
eePntr = eePntr + 1
IF (char = 0) THEN EXIT
SEROUT Sout, Baud, [noparse][[/noparse]char]
LOOP
HIGH 3
PAUSE 1000
LOW 3
PAUSE 1000
RETURN
END

Comments

  • Tom WalkerTom Walker Posts: 509
    edited 2005-09-23 18:55
    That code is intended to send out the string exactly as it is in the DATA statement. Aside from that, you have not provided enough info to determine what would happend at your dialling device.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • leshea2leshea2 Posts: 83
    edited 2005-09-23 21:59
    So will a string be received by another device as an electrical command, or just as words ?
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-09-24 01:12
    leshea2 -

    The direct answer to your question is both. By necessity all information which comes into or out of a computer, microcontroller, PDA, etc is directly or indirectly an electrical signal, or some medium (light, sound, etc) which can be easily converted into an electrical signal. If the electrical signal only varies in its electrical characteristics (voltage, frequency, etc) this is called analog data, or an analog signal.

    These electrical signals can however be sent in such a way that within them there is contained data; usually binary in nature, which consists of ones and zeros, in specific and regulated patterns. This is the essense of digital data - information formatted in a formal and consistant manner which can be transmitted directly or indirectly by electrical signals. This digital information may be formatted by use of various pre-defined protocols.

    These protocols determine how the data will appear, how it is to be interpreted, what the electrical signal levels are, and what if any timing data is included to pace the data transmission. Digital data may be transmitted (exchanged) with inherent timing contained within the data stream, or with a separate means of timing the data for proper cadence at the receiving end.

    When the timing is inherent and contained in the data, this is knows as asynchronous serial data transmission. One method of transmitting asynchronsous serial data is the RS-232 protocol. The SERIN / SEROUT commands utilize the RS-232 protocal for transmitting asynchronsous serial data. Within the RS-232 protocol are also specific voltage levels, line capacitance levels, and similar parameters which should be respected, if transmission is to be "guaranteed". So too there are distance limitations which also must be respected. Both the sending and receiving ends must respect all the rules and limitations of the common protocol they are using, irrespective of what that protocol is.

    So, in summary, SERIN / SEROUT transmit and receive DIGITAL DATA (messages if you will) which can be received by any other device capable of understanding the RS-232 protocol and which utilize the common data transmission parameters they must share, BUT it does this by using ANALOG ELECTRICAL SIGNALS.

    I hope that helps, and doesn't confuse you more.

    I may be worthwhile to let us know what type of device you are attempting to communicate with. We may then be able to provide better and SHORTER answers smile.gif

    Regards,

    Bruce Bates
  • leshea2leshea2 Posts: 83
    edited 2005-09-24 23:47
    Thank you vary much, that's vary helpful!
Sign In or Register to comment.