5: BASIC Stamp Command Reference – SLEEP
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 317
SLEEP
BS1 BS2 BS2e BS2sx BS2p
SLEEP
Period
Function
Put the BASIC Stamp into low-power mode for a specified time.
•
Period
is a variable/constant/expression (1 – 65535) that specifies
the duration of sleep. The unit of time for Period is 1 second, though
the BASIC Stamp rounds up to the nearest multiple of 2.3 seconds.
Quick Facts
BS1
BS2
BS2e
BS2sx
BS2p
Current draw
during run
2 mA
8 mA
25 mA
60 mA
40 mA
Current draw
during SLEEP
20 µA
40 µA
60 µA
60 µA
60 µA
Accuracy of
SLEEP
±1% @ 75
°
F
with stable
power supply
±1% @ 75
°
F
with stable
power supply
±1% @ 75
°
F
with stable
power supply
±1% @ 75
°
F
with stable
power supply
±1% @ 75
°
F
with stable
power supply
Explanation
SLEEP allows the BASIC Stamp to turn itself off, then turn back on after a
programmed period of time. The length of SLEEP can range from 2.3
seconds to slightly over 18 hours. Power consumption is reduced to the
amount described in Table 5.93, assuming no loads are being driven. The
resolution of the SLEEP instruction is 2.304 seconds. SLEEP rounds the
specified number of seconds up to the nearest multiple of 2.304. For
example, SLEEP 1 causes 2.3 seconds of sleep, while SLEEP 10 causes 11.52
seconds (5 x 2.304) of sleep.
Pins retain their previous I/O directions during SLEEP. However, outputs
are interrupted every 2.3 seconds during SLEEP due to the way the chip
keeps time. The alarm clock that wakes the BASIC Stamp up is called the
watchdog timer. The watchdog is a resistor/capacitor oscillator built into
the interpreter chip. During SLEEP, the chip periodically wakes up and
adjusts a counter to determine how long it has been asleep. If it isn’t time
to wake up, the chip “hits the snooze bar” and goes back to sleep.
To ensure accuracy of SLEEP intervals, the BASIC Stamp periodically
compares the watchdog timer to the more-accurate resonator time base. It
1
2
e
2
sx
2
p
2
1
NOTE: Expressions are not
allowed as arguments on the BS1.
Table 5.93: SLEEP Quick Facts.
Содержание BASIC Stamp 2e
Страница 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...