Rainbow Electronics АТ89С51 User Manual

At89c51 in-circuit programming

Advertising
background image

5-11

AT89C51 In-Circuit Programming

This application note illustrates the in-cir-
c u i t p r o g r a m m a b i l i t y o f t h e A t m e l
AT89C51 Flash-based microcontroller.
Guidelines for the addition of in-circuit
programmability to AT89C51 applica-
tions are presented along with an appli-
cation example and the modifications to
it required to support in-circuit program-
ming. A method is then shown by which
the AT89C51 microcontroller in the
a p p l i c a t i o n c a n b e r e p r o g r a m m e d
remotely, over a commercial telephone
line. The circuitry described in this appli-
cation note supports five volt program-
m i n g o n l y , re q u i rin g th e u s e o f a n
AT89C51-XX-5. The standard AT89C51
requires 12 volts for programming.

The software for this application may be
obtained by downloading from Atmel’s
BBS: (408) 436-4309.

General Considerations

Circuitry added to support AT89C51 in-
circuit programming should appear
transparent to the application when pro-
gramming is not taking place.

EA/VPP must be held high during pro-
gramming. In applications which do not
utilize external program memory, this pin
may be permanently strapped to V

CC

.

Applications utilizing external program
memory require that this pin be held low
during normal operation.

RST must be held active during pro-
gramming. A means must be provided
for overriding the application reset cir-
cuit, which typically asserts RST only
briefly after power is applied.

PSEN must be held low during program-
ming, but must not be driven during nor-
mal operation.

ALE/PROG is pulsed low during pro-
gramming, but must not be driven during
normal operation.

During programming, AT89C51 I/O ports
are used for the application of mode
select, addresses and data, possibly
requiring that the controller be isolated
from the application circuitry. How this is
done is application dependent and will
be a ddre sse d he re on ly in gen era l
terms.

Port Used for Input
During programming, the controller must
be isolated from signals sourced by the
application circuitry. A buffer with three-
state outputs might be inserted between
the application circuitry and the control-
ler, with the buffer outputs three-stated
when programming is enabled. Alter-
nately, a multiplexer might be used to
select between signal sources, with sig-
nals applied to the controller by either
the application circuitry or the program-
mer circuitry.

Port Used for Output
No circuit changes are required if the
application circuitry can tolerate the state
changes which occur at the port during
programming. If the prior state of the
application circuitry must be maintained
during programming, a latch might be
inserted between the controller and the
application circuitry. The latch is enabled
during programming, preserving the
state of the application circuitry.

An Application Example

The AT89C51 application shown in Fig-
ure 1 is an implementation of a moving
display. This application was selected for
its simplicity and ability to show graphi-
cally the results of in-circuit reprogram-
ming. The text to be displayed is pro-
grammed into the controller as part of its
firmware, and cannot be changed with-
out reprogramming the device.

0287D-B–9/97

8-Bit
Microcontroller
with Flash

Application
Note

Advertising