serial pins
cplatt
Posts: 55
Sorry for the ignorance here.
I understand how to serially communicate using serin with the stamp via the com port on the BOE and pin16. The my stamp basically listens every half second for the PC to send something.
I would like to add an additional pin somehow for data control. (sorry I do not know this term) so instead of constantly listening, the PC sends a message "wake up you stamp here comes a message", and the stamp says "ok I am ready to receive it".
I assume I have to get into the DB9 connector somehow to run a shunt to another pin on the BOE, there is a lot of info in the stamp manual but it is not so clear to me.
Any links would be greatly appreciated.
I understand how to serially communicate using serin with the stamp via the com port on the BOE and pin16. The my stamp basically listens every half second for the PC to send something.
I would like to add an additional pin somehow for data control. (sorry I do not know this term) so instead of constantly listening, the PC sends a message "wake up you stamp here comes a message", and the stamp says "ok I am ready to receive it".
I assume I have to get into the DB9 connector somehow to run a shunt to another pin on the BOE, there is a lot of info in the stamp manual but it is not so clear to me.
Any links would be greatly appreciated.
Comments
If you are using the programming port and P16 you could do
SEROUT tx,baud,[noparse][[/noparse]"Rdy"]
SERIN rx,baud,timeout_value,timeout_label,[noparse][[/noparse]DataIn]
and have the PC look for the Rdy signal
If you are using a line driver such as the Max232 you could attach a third wire to the CTS line for a hardwired flow control and do
HIGH CTS
SERIN rx,baud,timeout_value,timeout_label,[noparse][[/noparse]DataIn]
LOW CTS
and have the PC look for the·CTS line going high
Jeff T.
The PC will buffer up anything sent from the BS2, so one way is to have the BS2 periodically send a "!" (or some signal character) just before it does your time-out SERIN to notify the PC it's ready for data, if any.
I suppose you COULD use the "RTS" signal from the PC, IF you can get control of the signal separately from the 'standard serial port' useage. Under VB6, you could do this with the RTSEnable method of the MSCOMM control. I've done this under RealBASIC by opening the COM port -- but I don't have that code handy right now.
And you would need to add a wire from the RTS signal to some I/O pin of the BS2 (through a 22 Kohm resistor -- the PC drives this pin with +-3 volts to +-10 volts, the 22 Kohm resistor will protect the BS2).