|
by Jamie
Pollock
Start ı Problem
Solving ı EEPROM Programming ı Some
Assemblyı ı Interfacing the LCD ı Sources
and PDF
Single chip solutions using the MC68HC11
series microcontrollers can be cost effective for many applications.
For the beginning designer or hobbyist, most development systems are
beyond practical consideration due to their high cost.
Although development systems are robust
with a great diversity in hardware and software, a few application
notes and some wire wrap can go a long way. The system here can be
built for under $20, excluding the LCD.
Besides cost, time-to-market is also
important. If you canıt see progress in your efforts, it becomes difficult
to maintain good motivation. Projects like LCD-displayed temperature,
a lawn-sprinkler controller, or a simple stopwatch are inexpensive
projects with great learning potentials.
In the petroleum industry, the viscosity
of a product is important. The viscosity baths I use hold six tubes.
Two baths are needed, one at 100ıC and another at 40ıC, to characterize
the fluids.
If I try to test six products then I
need 12 timers. This can become confusing and more than once Iıve
had to restart the test because of carelessness.
This project will create five independent
stopwatches on a 40-character LCD display. The controls for each timer
will be directly below the LCD screen. A start/stop button and a clear
button for each timer will be sufficient for measuring viscosity time.
The display will show seconds and milliseconds
because those increments are necessary for the calculation of viscosity.
Four characters are allotted for the seconds and two for the milliseconds.
The timers will rollover at 9999.99 or 2.77 hours. A typical viscosity
test takes about 300 s.
The minimum configuration for the MC68HC11
consists of three partsıthe microcontroller, a crystal oscillator
and a low voltage reset IC. First, the controller must be chosen.
For the simple stopwatch project, I chose the MC68HC11F1CFN3 primarily
because it has enough I/O ports to easily get the job done.
Second, a 12-MHz crystal oscillator is
needed to give an internal clock of 3 MHz. (The last digit in the
controller part number is its maximum speed). The ı6811 divides the
external oscillator by four to generate the internal clock.
Third, a MC34064 (low-voltage reset)
is needed to properly initialize the controller. This is specific
to the ı6811 line, other microcontrollers donıt require this.
Finally, pull-up resistors are needed
on the XIRQ, IRQ, and any input ports. The extras include an OPTREX
DMC 40218 40 ı 2 character LCD and a homemade keypad. The LCD was
taken from a dead typewriter and the buttons for the keypad were taken
from an old printer. Recycling old parts is extremely important for
hobbyists.
Because this project is a single-chip
solution, the controller will be used in a special mode called bootstrap
mode. This mode allows the controller to execute a 256-byte program
in ROM at startup, which Motorola created.
The Motorola code initializes the serial
communications interface allowing an RS-232 transceiver like the MC145407
to connect the controller to a PC port.
Bootstrap mode provides a means to program
the RAM. This code receives a byte from the RS-232 port and places
it into RAM in sequential order, starting at location $0000. The code
uses a timer to exit the loop. Once the timeout is activated, the
controller jumps to the beginning of RAM executing the downloaded
program. Bootstrap code listings are available on the Internet for
most of the ı6811 line. Studying the listing is essential to understanding
the bootstrap operation.
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. |