Table 5.60: POLLWAIT Quick
Facts.
5: BASIC Stamp Command Reference – POLLWAIT
POLLWAIT
2
POLLWAIT Period
p
Function
Pause program execution, in a low-power mode, in units of Period until
any polled-input pin reaches the desired poll state.
• Period is a variable/constant/expression (0 – 8) that specifies the
duration of the low-power state. The duration is (2^Period) * 18 ms.
Table 5.61 indicates the low-power length for any give Period. Using
8 as the Period is a special case; the BS2p will not go into low-power
mode and will respond quicker to polled-inputs.
Quick Facts
Current draw
during
POLLWAIT
Response time
with Period
set to 8
Special notes
Explanation
The POLLWAIT command is one of a family of unique "polling"
commands on the BS2p module. The other commands in this family
include POLLIN, POLLMODE, POLLOUT and POLLRUN.
POLLWAIT command is used to pause program execution and go into a
low-power state until any polled-input pin reaches the desired poll state.
The "polling" commands allow the BASIC Stamp to respond to certain I/O
pin events at a faster rate than what is normally possible through manual
PBASIC programming.
BASIC Stamp's interpreter periodically checks the state of the designated
polled-input pins. It "polls" these pins after the end of each PBASIC
command and before it reads the next PBASIC command from the user
program; giving the appearance that it is polling "in the background".
This feature should not be confused with the concept of interrupts, as the
BASIC Stamp does not support true interrupts.
BS1
BS2
BS2e BS2sx
• Poll mode must be 2 or 4 and at least one polled-input must be set to
activate POLLWAIT (POLLWAIT will be ignored otherwise).
• If both polled-wait and polled-run are active, the polled-run event will
occur immediately after the polled-wait detects an event.
The term "poll" comes from the fact that the
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 235
BS2p
BS2p
60 µA
Less than 160 µS
The
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?