BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – POLLWAIT
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 335
POLLWAIT
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
POLLWAIT Duration
Function
Pause program execution, in a low-power mode, in units of Duration until
any polled-input pin reaches the desired poll state.
Duration is a variable/constant/expression (0 – 8) that specifies the
duration of the low-power state. The duration is (2^Duration) * 18
ms. Table 5.82 on page 336 indicates the low-power length for any
given Duration. Using 8 as the Duration is a special case; the BS2p,
BS2pe, and BS2px will not go into low-power mode and will
respond quicker to polled-inputs.
Quick Facts
Table 5.81: POLLWAIT Quick
Facts.
BS2p BS2pe BS2px
Current draw
during
POLLWAIT
350 µA 36 µA
450 µA
Response Time
with Duration
set to 8
Less than 160 µs Less than 250 µs
Less than 100 µs
Accuracy of
NAP
–50 to 100% (±10% @ 75°F with stable power supply)
Special Notes
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.
Useful SPRAM
Locations
Locations 128 – 135 hold polled interrupt status. See Table 5.77 in the
POLLMODE command section for more information.
Related
Commands
POLLMODE, POLLIN, POLLOUT, POLLRUN, END, NAP and SLEEP
Explanation
The 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. The term "poll" comes from the fact that the
BASIC Stamp's interpreter periodically checks the state of the designated