|
Part 2: Revving It Up
by Fred Eady
Start ý Tera
Term Pro ý Road Test ý The
Hardware ý As a Web Server ý Branching
Out ý Making Changes ý ReadyýSet?
ý Go ý Sources
and PDF
TERA TERM PRO
This terminal emulator adds class and a
bit of automation to the boot loader PIC code. I assembled a simple
macro program to run under Tera Term Pro (see Listing
2), which guides you through
the S-7600A/PIC16F877 Internet Engine file upload process. Basically,
the Tera Term Pro macro (upload.ttl) connects to the S-7600A/PIC16F877
Internet Engine via a personal computerýs COM2 serial port and uploads
code to the PIC16F877 by way of the boot loader code.
Letýs analyze the macro beginning with
the definitions area. Tera Term Pro uses message boxes that look like
their standard Windows counterparts to communicate with you. The boxtitle
defines the text that resides in the title area of the message box.
The rest of the definitions in this area are the wording that will
appear in message boxes called from various parts of the macro. The
only exception is uploadfile, which is actually the Intel hex
file that is loaded and executed. In my macro, this file is called
seiko.hex and is actually the web server code.
Moving on to the main macro code area,
you find the label :begin followed by a connect command. The
/C=2 tag says connect to the personal computerýs COM2 serial
port. The connect command returns a result code. If the result code
is 0, a link to Tera Term Pro has not been made. A result code of
1 means the link to Tera Term Pro is good but there is no connection
to the host. You want a result code of 2, which tells you that the
link to Tera Term Pro and the connection to the host are up.
Result codes of 0 and 1 trigger a messagebox
event that informs you of the error and disconnects Tera Term Pro.
A result code of 2 causes the macro code to branch to the :goodlink
label. A yesnobox is triggered asking if you would like to
upload code to the S-7600A/PIC16F877 Internet Engine.
If you glance at the boot loader listing,
youýll see that an ASCII "u" activates the upload portion
of the code. A yes tells Tera Term Pro to send the ASCII "u"
to the boot loader code and wait for the outcome of the upload process.
The S-7600A/PIC16F877 Internet Engine boot loader code will send an
ASCII "g" if the upload is good and an ASCII "E"
if any of the checksum calculations donýt match the original line-by-line
checksums.
As you can see in the macro listing,
a "g" is result code 1 and the "E" is result code
2. This is determined by the order of the ASCII characters behind
the wait command. A no answer to the upload question
simply keeps Tera Term Pro connected and nothing else. The boot loader
will time out and attempt to run the boot vector code.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |