This repository has been archived on 2024-09-22. You can view files and clone it, but cannot push or open issues or pull requests.
pbi-ide/help/BasicStampHelp/Content/LanguageTopics/Commands/END.htm

127 lines
8.1 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="6" MadCap:lastHeight="94" MadCap:lastWidth="853" MadCap:disableMasterStylesheet="true" MadCap:tocPath="" MadCap:InPreviewMode="false" MadCap:PreloadImages="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" lang="en-us" xml:lang="en-us" MadCap:PathToHelpSystem="../../../" MadCap:HelpSystemFileName="Default.xml" MadCap:SearchType="Stem">
<head><title>END</title>
<link href="../../SkinSupport/MadCap.css" rel="stylesheet" />
<link href="../../Resources/Stylesheets/BSE_Help.css" rel="stylesheet" />
<script src="../../SkinSupport/MadCapAll.js" type="text/javascript">
</script>
</head>
<body>
<h1 class="code">END</h1>
<div class="ImagePlusCaption">
<div class="Col2">
<p>
<img src="../../graphics/pgm_icon1.gif" border="0" alt="BS1 icon" title="BS1 icon" />
<img src="../../graphics/pgm_icon2.gif" border="0" alt="BS2 icon" title="BS2 icon" />
<img src="../../graphics/pgm_icon2e.gif" border="0" alt="BS2e icon" title="BS2e icon" />
<img src="../../graphics/pgm_icon2sx.gif" border="0" alt="BS2sx icon" title="BS2sx icon" />
<img src="../../graphics/pgm_icon2p.gif" border="0" alt="BS2p icon" title="BS2p icon" />
<img src="../../graphics/pgm_icon2pe.gif" border="0" alt="BS2pe icon" title="BS2pe icon" />
<img src="../../graphics/pgm_icon2px.gif" border="0" alt="BS2px icon" title="BS2px icon" />
</p>
</div>
<p style="text-align: right;">&#160;</p>
<p>&#160;</p>
</div>
<p class="clear">&#160;</p>
<p>&#160;</p>
<p class="PlainText">Syntax: <span class="keyword_in_text">END</span></p>
<h2>Function</h2>
<p class="PlainText">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 <span class="keyword_in_text">END</span> command is optional, but recommended.</p>
<h2>Quick Facts</h2>
<table width="100%" cellpadding="4" cellspacing="0" border="1">
<tr align="center" bgcolor="#CFCFCF">
<td width="23%">&#160;</td>
<td width="11%">BS1</td>
<td width="11%">BS2</td>
<td width="11%">BS2e</td>
<td width="11%">BS2sx</td>
<td width="11%">BS2p</td>
<td width="11%">BS2pe</td>
<td width="11%">BS2px</td>
</tr>
<tr align="center">
<td bgcolor="#CFCFCF">Approximate current draw @ 5 VDC during Run *</td>
<td>1 mA</td>
<td>3 mA</td>
<td>25 mA</td>
<td>60 mA</td>
<td>40 mA</td>
<td>15 mA</td>
<td>55 mA</td>
</tr>
<tr align="center">
<td bgcolor="#CFCFCF">Approximate current draw @ 5 VDC during END *</td>
<td>25 µA</td>
<td>50 µA</td>
<td>200 µA</td>
<td>500 µA</td>
<td>350 µA</td>
<td>36 µA</td>
<td>450 µA</td>
</tr>
<tr>
<td align="center" bgcolor="#CFCFCF">Related Commands</td>
<td align="center" colspan="1">
<p colspan="1" align="center"><a href="NAP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">NAP</a>, <a href="SLEEP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">SLEEP</a></p>
</td>
<td align="center" colspan="3">
<p colspan="3" align="center"><a href="NAP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">NAP</a>, <a href="SLEEP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">SLEEP</a>, <a href="STOP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">STOP</a></p>
</td>
<td align="center" colspan="3">
<p colspan="3" align="center"><a href="NAP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">NAP</a>, <a href="SLEEP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">SLEEP</a>, <a href="STOP.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">STOP</a>, <a href="POLLWAIT.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">POLLWAIT</a></p>
</td>
</tr>
</table>
<p>*Note: This is an approximate value, not including loads on the I/O pins</p>
<h2>Explanation</h2>
<p class="PlainText"><span class="keyword_in_text">END</span> 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. <span class="keyword_in_text">END</span> 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.</p>
<p class="PlainText">During execution of power conserving commands (<span class="keyword_in_text">END</span>, <span class="keyword_in_text">NAP</span>, <span class="keyword_in_text">POLLWAIT</span>, and <span class="keyword_in_text">SLEEP</span>), 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.</p>
<p class="PlainText">If you plan to use <span class="keyword_in_text">END</span>, <span class="keyword_in_text">NAP</span>, <span class="keyword_in_text">POLLWAIT</span>, or <span class="keyword_in_text">SLEEP</span> 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. </p>
<div class="Col2">
<div class="MasterFoot">
<p MadCap:conditions="BSEconditions.BSEWebHelp (Primary)-INCLUDE"><a href="../../HomeTopics/HomePage.htm">Go to Welcome page</a>
</p>
</div>
</div>
<div class="Col2">
<div class="MasterFoot">
<p style="text-align: right;"><span class="ContactInfoProjectName">BASIC Stamp Help</span> <![CDATA[ ]]><span class="ContactInfoVersion#">Version 2.5.4</span> <![CDATA[ ]]></p>
<p style="text-align: right;">Copyright ©&#160;<span class="ContactInfoCompanyName">Parallax Inc.</span></p>
<p style="text-align: right;"><span class="SystemShortDate">8/8/2012</span>
</p>
</div>
</div>
<script type="text/javascript">/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-285614-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
/* ]]> */</script>
<script type="text/javascript" src="../../SkinSupport/MadCapBodyEnd.js">
</script>
</body>
</html>