NAP - BASIC Stamp Command Reference
Page 192
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
the actual timing to vary by as much as –50, +100 percent (i.e., a Period of 0,
NAP can range from 9 to 36 ms). At room temperature with a fresh
battery or other stable power supply, variations in the length of a NAP
will be less than ±10 percent.
One great use for NAP is in a battery-powered application where at least
some small amount of time is spent doing nothing. For example, you may
have a program that loops endlessly, performing some task, and pausing
for approximately 100 ms each time through the loop. You could replace
your PAUSE 100 with NAP 3, as long as the timing of the 100 ms pause
was not critical. The NAP 3 would effectively pause your program for
about 144 ms and, at the same time, would place the BASIC Stamp in low-
power mode, which would extend your battery life.
If your application is driving loads (sourcing or sinking current through
output-high or output-low pins) during a NAP, current will be interrupted
for about 18 ms when the BASIC Stamp wakes up. The reason is that the
watchdog-timer reset that awakens the BASIC Stamp also causes all of the
pins to switch to input mode for approximately 18 ms. When the
interpreter firmware regains control of the processor, it restores the I/O
direction dictated by your program.
If you plan to use END, NAP, or SLEEP in your programs, make sure that
your loads can tolerate these power outages. The simplest solution is
often to connect resistors high or low (to +5V or ground) as appropriate to
ensure a continuing supply of current during the reset glitch.
The demo program can be used to demonstrate the effects of the NAP
glitch with an LED and resistor as shown in Figure 5.16.
A
GREAT USE FOR
NAP;
FREE POWER
SAVINGS
.
T
IPS FOR DRIVING LOADS DURING
NAP.
Содержание BASIC Stamp 1
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...