END

BS1 icon BS2 icon BS2e icon BS2sx icon BS2p icon BS2pe icon BS2px icon

 

 

 

 

Syntax: END

Function

End the program, placing the BASIC Stamp into low-power mode indefinitely. This is equivalent to having a program that does not loop continuously; once the BASIC Stamp reaches the end of the PBASIC program, it enters low-power mode indefinitely. The END command is optional, but recommended.

Quick Facts

  BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
Approximate current draw @ 5 VDC during Run * 1 mA 3 mA 25 mA 60 mA 40 mA 15 mA 55 mA
Approximate current draw @ 5 VDC during END * 25 µA 50 µA 200 µA 500 µA 350 µA 36 µA 450 µA
Related Commands

NAP, SLEEP

NAP, SLEEP, STOP

NAP, SLEEP, STOP, POLLWAIT

*Note: This is an approximate value, not including loads on the I/O pins

Explanation

END puts the BASIC Stamp into its inactive, low-power mode. In this mode the Stamp's current draw (excluding loads driven by the I/O pins) is reduced to the amount shown above. END keeps the BASIC Stamp inactive until the reset line is activated, the power is cycled off and back on or the PC downloads another program.

During execution of power conserving commands (END, NAP, POLLWAIT, and SLEEP), current will occasionally be interrupted on I/O pins for about 18 ms durations (60 µs on the BS2pe). The reason is that the watchdog-timer reset that awakens the BASIC Stamp during these commands also causes all of the pins to switch to input mode for approximately 18 ms (60 µs on the BS2pe). 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, POLLWAIT, 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.

Go to Welcome page

BASIC Stamp Help Version 2.5.4

Copyright © Parallax Inc.

8/8/2012