|
The Easy Way
by Charles Kosina
Start ý An
Example ý State Machine Control ý Keyboard
Scanning ý Receive Serial Data ý LCD
Module ý Transmit Data ý Debugging
Techniques ý Other Options ý Sources
and PDF
LCD MODULE
All the gathered data is displayed on
a 20 ý 2 LCD module. Figure 3 shows the state machine for this task,
where state 0 monitors flags from the other tasks. As soon as one
is set, the appropriate field on the LCD is updated. Incoming data
from the RS-232 port is displayed on the first line, and keyed-in
data is displayed on the second line.
|
|
| Figure 3ýHere are the LCD module
state machine test flags from the keyboard and RS-232 state
machines. The appropriate field is updated on the module when
a flag is detected. |
I have to confess to breaking one of
my own rules. In the drivers for the LCD, I have delays of up to several
milliseconds, which (though timer-generated) are totally within one
of the states. This doesnýt create any problems in this example, but
for complex and time-critical applications, the display drivers should
be rewritten to avoid this.
PREVIOUS
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. |