In the Nuts & Volts PICAXE Primer column, we just completed a three-installment series that focused on methods of
interfacing various inexpensive character-based LCDs with PICAXE microcontrollers.
Since LCDs have been on my mind lately,
they are the first thing I thought of when I sat
down to plan this month’s TankBot article.
In fact, when I started testing the EZ1
ultrasonic range finder that we worked with
last time, it was hard to resist the temptation
to stop in the middle of things to add an
LCD to the TankBot so that I could display
real-time, distance-to-obstacle data right on
the TankBot itself. Now that the EZ1 article is
finished, that’s exactly what we’re going to
do. This month, we’ll focus on the hardware
details of the project and, next time, we’ll
explore two real-time software applications:
distance-to-obstacle measurement and
battery voltage monitoring.
Because the basic
details of LCD interfacing
are already available in the
PICAXE Primer series in
Nuts & Volts (April, June,
and August, 2009), I
won’t repeat them here.
However, a brief overview
will still be helpful. Our
discussion will be limited to
LCDs based on the Hitachi
HD44780 controller chip
because they are readily
available and relatively
inexpensive. These displays
all use a parallel data
transfer scheme that
requires a minimum of six
data lines. It’s certainly
possible to directly interface
an HD44780-based LCD
with the TankBot’s
PICAXE-14M processor.
However, doing so would
tie up six I/O lines and
the necessary software
would require almost all
of the 14M’s program
memory. We solved this problem in
the Primer articles by dedicating a
separate 14M as a peripheral
processor for the LCD. The software
we developed simply accepts
standard serial data from a “master
processor” and converts it to the
parallel format required by an
HD44780 LCD.
Constructing a
Serial LCD Board
If you enjoy the challenge and
satisfaction of developing your own
hardware projects, you may want to
construct one of the stripboard
circuits we developed in the Primer
series. If not, you can also use the
printed circuit board (PCB)
version of the project that’s
available on my site www.jr
hackett.net/LCD08.shtml).
Either way, we are going to
mount a completed eight-character by two-line serial
LCD to our TankBot and
interface it with the
BrainAlpha PCB.
Mounting the LCD to
the TankBot is a simple
procedure. (Figure 1
shows the mounting
arrangement viewed from
the back of the TankBot.)
To mount the LCD board
on the TankBot, you will
need two #4 or #6 one
inch bolts, six nuts, and
two lock-washers. If you
use #4 hardware, you’ll
also need a 1/8th inch
drill bit; for #6 hardware, a
9/64th inch drill bit is
necessary. Here’s the way
I did it:
Before assembling the
LCD board, place the bare board on
the small horizontal cross-piece of the
TankBot’s chassis (above the servo
motors; see Figure 1) so that its
bottom edge is about 1/16th inch
forward of the back edge of the
cross-piece.
Using two small spring clamps to
hold the board in position, drill two
SERVO 09.2009 67