5: BASIC Stamp Command Reference – POLLWAIT
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 235
POLLWAIT
BS1 BS2 BS2e BS2sx
BS2p
POLLWAIT
Period
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
BS2p
Current draw
during
POLLWAIT
60
µ
A
Response time
with Period
set to 8
Less than 160
µ
S
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.
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. 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
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.
Table 5.60: POLLWAIT Quick
Facts.
p
2
Summary of Contents for BASIC Stamp 2e
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...