From: Rich Webb
Subject: Re: Some newbie questions on interfaces and programming
Organization: Line Eater Memorial Fund
X-Newsreader: Forte Agent 1.92/32.570
Date: Thu, 05 Dec 2002 01:28:50 GMT
NNTP-Posting-Date: Wed, 04 Dec 2002 20:28:50 EST
On Wed, 4 Dec 2002 22:19:16 +0100 (CET), Anonymous
>Here's some easy questions:
>concerning the HD44780 LCD controller :
> do people use wire this up memory-mapped or connect it via a Programmable Parallel Interface chip?
I always use one 8-bit programmable I/O port on the micro. Using 4-bit
protocol to the LCD leaves one pin free for flashing an LED (see below).
Why add another chip?
> where can I find a device driver for this ( C/C++ header file ). Googling turned up one, are there
> more? Or more correctly phrased, is there a "standard" header?
There's lots of example code if you look for it but given the multitude
of processors, a standard header would be a stretch.
>I'm contemplating an 8-bit embedded app that will need at least six parallel interfaces, several interrupts
>and four timers and perhaps a DMA. This sounds like a bit much for a microcontroller, more like a job
>for a SBC. Any suggestions as to CPU? I trained on a Z80-based evaluation board (!!) many MANY moons ago
>so lean toward that group plus Zilog still seems to have alot of the peripheral chips still in production,
>as opposed to the 68k stuff which seems to be close to extinction.
More like a job for a couple or three microcontrollers. A small or
medium one to handle the I/O to the LCD, keypad/keyboard, and the
flashing lights (all embedded projects are required to have flashing
lights) and another, beefier one, to handle the grunt work. All tied
together with SPI or I2C.
I learned on Z80s too, way back when The Digital Group was state of the
art. I've come to appreciate the value of processors that have a deep,
general purpose register set. Look at TI's MSP430 family (16-bit) and
Atmel's AVR family (8-bit).
>How's the GNU C/C++ compiler for embedded code? Tricks/hints/suggestions?
Imagecraft has good, inexpensive C compilers for both the MSP430 and
Atmel AVR. I've never found it necessary or desirable to use C++ in
embedded projects, although I do use it regularly on PCs. (I still think
that somebody must have spiked the water that the C++ standards
committee was drinking, but that's another issue ;-)
You'll probably do best with assembly for the device level stuff. C is
handy as a wrapper and to do string handling and parsing. As in, if you
need to tear strings apart to validate user input and send back wordy
status messages, do that on the interface micro and pass the inner
device just the validated, digested commands.
Rich Webb Norfolk, VA