Parallax BASIC Stamp 2e Programming Manual page 292

Table of Contents

Advertisement

SERIN - BASIC Stamp Command Reference
Host PC
(for Debug)
Serial communication, because of its complexity, can be very difficult to
work with at times. Please follow these guidelines when developing a
project using the SERIN and SEROUT commands:
1.
Always build your project in steps.
a.
Start with small, manageable pieces of code, that deals
with serial communication) and test them, one at a time.
b. Add more and more small pieces, testing them each time,
as you go.
c.
Never write a large portion of code that works with serial
communication without testing its smallest workable
pieces first.
2.
Pay attention to timing.
a.
Be very careful to calculate and overestimate the amount
of time operations should take within the BASIC Stamp.
Misunderstanding the timing constraints is the source of
most problems with code that communicate serially.
b. If the serial communication in your project is bi-
directional, the above statement is even more critical.
3.
Pay attention to wiring.
a.
Take extra time to study and verify serial communication
wiring diagrams. A mistake in wiring can cause strange
problems in communication, or no communication at all.
Make sure to connect the ground pins (Vss) between the
devices that are communicating serially.
4.
Verify port setting on the PC and in the SERIN/SEROUT
commands.
a.
Unmatched settings on the sender and receiver side will
cause garbled data transfers or no data transfers. If the
Page 290 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
programming
cable
P1
BS2
P0
receiver
10k
VSS
Figure 5.33: Flow-Control Example
Circuit.
P1
BS2
P0
sender
VSS
SERIN T
.
ROUBLESHOOTING

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents