27220 Parallax Inc, 27220 Datasheet - Page 213

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
Moving Forward · Page 203
The CTS connection tells the PC that the BASIC Stamp is ready to receive data.
Remember that the BASIC Stamp does not buffer serial data and if the PC sent a
byte when the BASIC Stamp was busy processing another instruction that byte would
be lost.
After initializing the LED outputs and the DS1620, the program enters the main loop
and waits for input from the terminal program. First, SERIN waits for the "?"
character to arrive, ignoring everything else until that happens. The question mark,
then, is what signifies the start of a query. Once a question mark arrives, the HEX
modifier causes the BASIC Stamp to look for valid hex characters (0 - 9, A - F). The
arrival of any non-hex character (usually a carriage return [Enter] when using a
terminal) tells the BASIC Stamp to stop accepting input (to the variable called cmd)
and continue on.
What actually has happened is that the BASIC Stamp has used the SERIN instruction
to do a text-to-numeric conversion. Now that a command is available, the program
uses SELECT-CASE to process valid commands, and sends a message to the
terminal if the command entered is not used by the program.
For valid commands the BASIC Stamp responds to a request sending a text string
using SEROUT. As with SERIN, flow control is used with SEROUT as well. The RTS
(Request To Send) connection allows the PC to let the BASIC Stamp know that it is
ready to receive data.
Each of the response strings consists of a label, the equal sign, the value of that
particular parameter and finally, a carriage return. When using a terminal program,
the output is easily readable. Something like this:
ID = StampWorks 2.1
The carriage return at the end of the output gives us a new line when using a
terminal program and serves as an "end of input" when we process the input with
our own program (similar to StampPlot Lite). The equal sign can be used as a
delimiter when another computer program communicates with the BASIC Stamp.
We’ll use it to distinguish the label from its value.
Most of the queries are requests for information. Two of them, however, can modify
information that is stored in the BASIC Stamp.

Related parts for 27220