Rainbow Electronics AT89C2051 User Manual

Rainbow Electronics Storage

Advertising
background image

5-47

Using the AT89C2051 Microcontroller

as a Virtual Machine

It is often cited that what differentiates an
embedded microcontroller from other
general purpose computing devices is its
integration into a larger electrical or elec-
tro-mechanical system. While this is
generally true, the fact remains that pro-
cessors of widely differing capability and
architecture are employed in this regard.

Unfortunately, this broad explanation
defines nothing; we are still left to con-
tend with everything from full-blown
embedded PCs to the smallest self-con-
tained single-chip microcontrollers.
Within this expansive realm, conven-
tional wisdom may lead to the conclu-
sion that the smallest microcontrollers
are only appropriate for driving small-
scale applications with very limited pro-
cessing requirements. While this is
u n q u e s t i o n a b l y t h e c a s e i n m a n y
instances, a class of applications exists
that mandates a relatively high level of
program complexity within severely con-
strained space limitations. Faced with
such a seeming paradox, engineers
often feel they have no choice but to
adopt a less than optimal design strat-
egy using a larger microcontroller than
originally intended.

The problem, of course, is one of limited
resources. Functional complexity implies
a non-trivial program, and the greater
the functional complexity the larger the
program. Even as the capability of small
single-chip microcontrollers continu-
o u s l y i n c h e s u p w a r d s , a p p l i c a t i o n
requirements seem to grow at a com-
mensurate rate. Trying to hit such a
moving target is difficult at best.

The economy of using a microcontroller
with just enough processing power for a
given application is a potent incentive to
find just the right fit. Of course, this only

works when the system requirements
are thoroughly understood and clearly
defined. Since such a design normally
has little reserve capacity, it is usually
hard pressed to handle features beyond
those originally specified. Should addi-
tional capabilities eventually become a
necessity, the result could be a system
that runs out of steam and an engineer
that runs out of options. Such are the
perils of designing on the edge.

Atmel’s AT89C2051 offers capabilities
that far exceed those of competing
devices of similar size. This opens up
potential design opportunities that were
simply unattainable with previously avail-
able parts. Housed in a 20-pin package,
Atmel’s miniature microcontroller retains
all the major features of the 8051 archi-
tecture. Furthermore, the AT89C2051
includes all of the 8051’s “special” pins
including the external interrupts, UART
transmit and receive lines, and the exter-
nal timer controls. Even though the
AT89C2051 significantly ups the pro-
cessing ante, it would seem that there
are limits to what you can accomplish
with any single-chip microcontroller.

This dilemma is nothing new. The tradi-
tional way of dealing with such limita-
tions has been to operate the microcon-
troller in external memory mode. Com-
mon sense would indicate the hopeless-
ness of applying such an approach to
t h e A T 8 9 C 2 0 5 1 . A f t e r a l l , t h e
AT89C2051 is truly a single-chip design
that does not even possess an external
bus structure. It turns out that the situa-
tion is not hopeless at all.

w

AT89C2051
Flash
Microcontroller

Application
Note

Advertising