Just For Starters
Figure 3 shows a flow chart for the
LED blinking ISR. The ISR maintains a
current state value that is incremented
on each interrupt. When the ISR is first
invoked, it references a predefined
table that contains the blinking pattern
in Table 1. Each current state value has
an associated LED on/off state. The
LED state is driven to a microcontroller
output pin that drives the LED.
Since there are only eight defined
states (though you could implement
as many as you wish), the ISR must
be sure to wrap the state value back
to zero when the current state is
seven. Otherwise, the state value
would increment past the end of the
blinking lookup table and undefined
operation would occur. The details of
actually programming a microcontroller
to perform these tasks vary with each
type of device. There are variations
on how timers and I/O pins are
configured and on how software and
ISRs are loaded into memory.
Architectural
Considerations
There is more to learn about how to
use discrete logic and microcontrollers
to solve design problems. Complete
Digital Design covers more
advanced logic design techniques
and microcontroller architecture and
implementation. It is important to
understand how architectural elements
add both flexibility and complexity to a
design. Working with microcontrollers
raises the level of complexity
somewhat, but provides great flexibility
through reprogramming. Going the
hard wired logic path may be simpler
for certain projects and also gives a
potential performance improvement
when necessary.
When you determine a pattern or
algorithm that must be executed, a
state machine may be the architectural
solution. How you choose to implement
that state machine will depend on the
resources you have available and how
each technology compares on capability
and complexity. NV
About the Author
F
o
r
E
l
e
c
t
r
o
n
i
c
s
NUTS & VOLTS
E
v
e
r
y
t
h
i
n
g
Mark Balch is the author of
Complete Digital Design (see
www.completedigitaldesign.com)
and works in the Silicon Valley high
tech industry. His responsibilities have
included PCB, FPGA, and ASIC design.
Mark has designed products in the
fields of telecommunications, HDTV,
consumer electronics, and industrial
computers. In addition to his work in
product design, he has participated in
industry standards committees and
has presented work at technical
conferences. Mark holds a bachelor’s
degree in electrical engineering from
The Cooper Union in New York
City. He can be reached via Email
at mark@completedigitaldesign.com
12
Circle #72 on the Reader Service Card.
JULY 2004