Shop OBEX P1 Docs P2 Docs Learn Events
SERIN program code used with Parallax GPS unit and BS2: OPEN MODE — Parallax Forums

SERIN program code used with Parallax GPS unit and BS2: OPEN MODE

510rock510rock Posts: 1
edited 2011-12-24 22:49 in BASIC Stamp
In the demo code they setup serial com with the following code:

T4800 Con 188
Open Con $8000
Baud Con Open | T4800 'Open mode to allow daisy chaining.

Then to pull various data out of the GPS they use:

SEROUT Sio, Baud, ["!GPS", GetDate]
SERIN Sio, Baud, 3000, No_Response, [timeHRS, timeMINS, timeSEC]

After searching and reading the serial section of the manual, I did not see any references
to what the Open mode or daisy chaining would be.

I would appreciate some help on understanding the purpose and use of this Open command. Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-24 22:49
    The output stage of a microcontroller I/O pin usually has one transistor that connects the I/O pin to Vdd and another transistor that connects the I/O pin to Vss. One or the other transistor (or neither) is turned on at a time (or the input circuitry is triggered by the I/O pin state). Normally the SEROUT works this way switching the I/O pin between Vdd (the idle state for SEROUT) and Vss. Open mode uses input mode as the idle state. SEROUT normally switches between input mode and Vss. It's assumed that there's a pullup resistor to Vdd somewhere for the I/O pin to set the idle state of the I/O line as Vdd. The reason for doing this is to allow more than one device to send data over the same wire. All of the devices use input mode for their idle state and switch to Vss for their active data state and the pullup provides the Vdd signal when they're all idle. If you didn't have open mode, all the devices would idle with the I/O line at Vdd. The first time one of them tried to transmit, you'd have a short circuit between Vss and Vdd and you'd probably burn out the device that tried to signal.

    In this case, daisy chaining just means that more than two devices are connected to the same I/O line. The term can mean something more complex as well.
Sign In or Register to comment.