<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/626714554f8811599ece6c60/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/626714554f8811599ece6c60/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">eForth for STM8S </div><div class="t m0 x1 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">Chen-Hanson Ting, 7/19/2010</div><div class="t m0 x1 h3 y4 ff1 fs0 fc0 sc0 ls0 ws0">1.<span class="_ _0"> </span>STM8S Discovery Board</div><div class="t m0 x1 h4 y5 ff2 fs0 fc0 sc0 ls0 ws0">The STM8S Discovery Board from STMicroelectronics Corp. is a very convenient </div><div class="t m0 x1 h4 y6 ff2 fs0 fc0 sc0 ls0 ws0">single board computer which allows you to evaluate STM8S chip and explore all its </div><div class="t m0 x1 h4 y7 ff2 fs0 fc0 sc0 ls0 ws0">capabilities. It is amazing that ST<span class="_ _1"></span> makes it available for less than $10. Such </div><div class="t m0 x1 h4 y8 ff2 fs0 fc0 sc0 ls0 ws0">generosity deserves a convenient operating system which an average user can interact<span class="_ _1"></span> </div><div class="t m0 x1 h4 y9 ff2 fs0 fc0 sc0 ls0 ws0">with the CPU and develop applications. STM8eForth is such a system. I am donating</div><div class="t m0 x1 h4 ya ff2 fs0 fc0 sc0 ls0 ws0">it to the public domain. You can use it and distribute it freely. You can also use it to </div><div class="t m0 x1 h4 yb ff2 fs0 fc0 sc0 ls0 ws0">develop applications for commercial purposes without any restriction.<span class="_ _1"></span> </div><div class="t m0 x1 h3 yc ff1 fs0 fc0 sc0 ls0 ws0">2.<span class="_ _0"> </span>Running STM8eForth</div><div class="t m0 x1 h4 yd ff2 fs0 fc0 sc0 ls0 ws0">STM8eForth system is distributed in the form of an assembly file stm8ef.asm. It is </div><div class="t m0 x1 h4 ye ff2 fs0 fc0 sc0 ls0 ws0">fully tested on STVD IDE which can be downloaded from www.st.com/stm8s-</div><div class="t m0 x1 h4 yf ff2 fs0 fc0 sc0 ls0 ws0">discovery. Install STVD on your computer. Create a new project. Add stm8sef.asm </div><div class="t m0 x1 h4 y10 ff2 fs0 fc0 sc0 ls0 ws0">to this project, build the project, and use the debugger to program the resulting binary<span class="_ _1"></span> </div><div class="t m0 x1 h4 y11 ff2 fs0 fc0 sc0 ls0 ws0">image to Discovery Board. To interact with the eForth system downloaded to </div><div class="t m0 x1 h4 y12 ff2 fs0 fc0 sc0 ls0 ws0">Discovery Board, you have to connect the UART2 port in STM8S to a COM port on </div><div class="t m0 x1 h4 y13 ff2 fs0 fc0 sc0 ls0 ws0">PC. The Discovery web page also distributes a Hyperterminal sample project which </div><div class="t m0 x1 h4 y14 ff2 fs0 fc0 sc0 ls0 ws0">shows you haw to make the connection. You have to open Hyperterminal application<span class="_ _1"></span> </div><div class="t m0 x1 h4 y15 ff2 fs0 fc0 sc0 ls0 ws0">under Windows to communicate with STM8S, using RS232 communication protocol </div><div class="t m0 x1 h4 y16 ff2 fs0 fc0 sc0 ls0 ws0">at 9600 baud, 8 data bits, 1 stop bit, and no parity.</div><div class="t m0 x1 h4 y17 ff2 fs0 fc0 sc0 ls0 ws0">Once STM8S chip on Discovery Board and Hyperterminal on PC are properly set up </div><div class="t m0 x1 h4 y18 ff2 fs0 fc0 sc0 ls0 ws0">and connected, you can type FORTH commands and STM8S with execute them. </div><div class="t m0 x1 h4 y19 ff2 fs0 fc0 sc0 ls0 ws0">Here are samples of conversation I copied from Hyperterminal screen:</div><div class="t m0 x1 h4 y1a ff2 fs0 fc0 sc0 ls0 ws0">When STM8S is turned on, it displays the sign-on message:</div><div class="t m0 x1 h5 y1b ff3 fs1 fc0 sc0 ls0 ws0">stm8eForth v2.1</div><div class="t m0 x1 h5 y1c ff3 fs1 fc0 sc0 ls0 ws0"> ok</div><div class="t m0 x1 h5 y1d ff3 fs1 fc0 sc0 ls0 ws0"> ok</div><div class="t m0 x1 h4 y1e ff2 fs0 fc0 sc0 ls0 ws0">If you press the Return key, eForth will echo "ok" with a linefeed.</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
</body>
</html>