56
June 2007
■ PHOTO 1. This is
the WWWLSEEP-1
Programmer.
applied to SDA
from the 1200,
and the SDA
also outputs data
to the 1200 when
requested. A
clock signal generated by the 1200 is applied to synchronize I/O operation.
The complete programmer development project includes
writing a Windows XP program to communicate with the
programmer, and coding the 1200 firmware. Of course, in
addition to creating the software serial port and communicating with a PC, the firmware must perform all read/write
programming functions through SCL and SDA. The firmware
is 854 bytes total, including the software serial port overhead.
Photo 1 shows the WWLSEEP-1 programmer. Notice
that all the signals and power supply are provided through
the DB- 9 connector; there is no separate power supply.
Also note that if the PC is not running the programmer
software but running the Hyper Terminal program instead, it
will show the character echo effect as in the first example.
Summing Up
We’ve seen two examples where a software serial port
is useful. It can save you money and it can (nearly) do the
same job as a hardware serial port. You’ll need some
memory space, but the overhead is less than 100 bytes. For
the 1K byte 1200, there is still a lot of program space left.
The timing requirement for the asynchronous communication is very forgiving at the 9600 bps speed. Examine to
see what will happen if you change the DLY49us to 50 µs by
adding an NOP (that’s equivalent to 1 µs) to the beginning
of the routine. You’ll see it is still okay.
Of course, there are limitations. The 1 MHz frequency is
too low if you want to get
a higher baud rate. At higher speeds the half_bitime
is reduced and it will be
hard to keep sampling in
the middle of each bit.
We may not be chip
makers, but we can
create a software serial
port for any MCU when
we need it. I have created a website containing
the software serial port
program source code for
different MCUs — just go
to www.geocities.com/
microappnotes. NV
FOR YOUR INFO
■ The following items are
available from:
G. Y. Xu, P.O.Box 14681
Houston, TX 77021, USA
Phone: (713) 741-3125
• Assembled and tested
WWLSEEP-1 Programmer —
$24.95 (with one free 24CXX)
• Printed Circuit Board and
Programmed AT90S1200 —
$10.00
For more information, go to
www.geocities.com/xumicro.