The main goals of this project:

1 - Create a generic modular hardware interface and associated driver routines
that can be easily used in other more complex projects. I wanted the complexity
to be non-trivial, but not overwhelming, either.

2 - Learn how to program an AVR using the GNU AVR-GCC compiler tool chain.

3 - Develop a useful, but simple macro set that can easily be reusable. This
completely eliminates low level assembler-like AVR uC extension instructions
in the high level C++ application code. The macro names are intended to be
self-documenting. This, in turn, eliminates the need for line-by-line instruction
documentation which greatly speeds up application development.

4 - Develop good debugging methods without resorting to using a software
based debugger.

I chose to use a discontinued LCD module, the Phico 'M-0 9949 94V-0", because
it has 3 LEDS, 4 pushbutton switches and a contrast control pot built into
it. It's an old model which uses the +5 volt-only Hitachi HD44780 LCD display
controller. This unit happens to have a 2-line by 40 character memory and
a 2 by 16 character physical display. This particular module model does not
have an LED backlight. Most LCD character modules on the market do have a
backlight.

The driver can be used with any 1, 2 or 4 line Hitachi-HD44780-controled
LCD display module. I implemented only the 4-bit data bus mode because there
few or no reasons to use the full 8-bit data bus. Actually, I first wrote
the code for only the 8-bit data mode to make debugging the timing signals
easier, but later removed that option.

Since all the code is written in C++ there should not be too much of an effort
needed to convert the code for use with a different compiler or even another
uC family (PIC ?). I separated the code into separate files because I use
different combinations of those utility functions in other projects. I like
to be able to "mix and match" at will.

I have also included lots of peripheral documentation. Complete code
documentation is located within their individual files.

Things I Have Learned Along the Way

1 - The data sheet for the Hitachi HD44780(U) really sucks, even despite
it being updated for inclusion of the 'U' lower voltage part variation. All
the glaring omissions present in the original version were carried over unchanged
into the updated version. This has nothing to do with Japanese-to-English
translation problems. Their technical writers were simply very sloppy.

2 - Since I didn't (want to learn and) use a software debugger, I designed
and hand-built small, but very useful pieces of prototyping and debugging
hardware that includes an 8-bit high impedance LED display module and a
ribbon-cable-to-solderless-breadboard adapter. I am surprised they turned
out so well.

3 - How to get the GNU AVR-GCC compiler tool chain to "sing and dance" any
way I want it to using it on the Windows XP platform. I would have probably
chosen to use the WinAVR IDE if I hadn't already learned to use the native
GNU C++ tool chain for Windows PCs. I will use WinAVR for larger projects,
but for this one it seemed like overkill.

The module shown "in action". From this photo you can't tell that the LEDs
are counting in binary and that the display window is shifting leftward by
3 characters per second. Note the natural high contrast - that's why this
module needs no backlight. The manufacturer of the basic LCD module mounted
to the PCB is unknown, which is typical.

My development platform.

It just doesn't get much simpler than this! Just barely visible is my adapter
board mounted to the back of the LCD module. It has just the 3 shrouded ribbon
cable PCB connectors and a bunch of 30 AWG wire-wrap wires soldered to the
appropriate pins. 20-pin ribbon cable shrouded PCB headers are perfect for
mounting on the Olimex AVR-P40-8535 board. So far just the A and D ports
are wired up, but there's lust room enough for the B and C ports, too.

I added the ribbon cable headers and single row pin headers for use as convenient
test points. I also added the green T1 LED (and its current limiting resistor)
to this Olimex board. It serves simply as a power-on indicator, which is
glaringly lacking in the Olimex design. An ATMega16-PU is being used here.

The programmer used (not shown) is the LadyAda USBtinyISP which also serves
to power the system with up to 100 mA of +5V. The USBtinyISP is implemented
with an Atmel ATiny uC ! AVRDude is used to download and verify the code
programming into FLASH and EEROM.

After you find an appropriate page, you are invited to
your
to this massmind site! (posts will be visible only to you before review)
Just type in the box and press the Post button.
(HTML welcomed, but not the <A tag:
Instead, use the link box to link to another page.
A tutorial is availableMembers can
login
to post directly, become page editors, and be credited for their posts.

Link? Put it here:
if you want a response,
please enter your email address:
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.