Download Print this page
Atmel AT89C51 Application

Atmel AT89C51 Application

8-bit microcontroller with flash
Hide thumbs Also See for AT89C51:

Advertisement

Quick Links

AT89C51 In-Circuit Programming
This application note illustrates the in-
circuit programmability of the Atmel
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 ap-
plication can be reprogrammed re-
motely, over a commercial telephone
line. The circuitry described in this appli-
cation note supports five volt program-
ming only, requiring the use of an
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
. Applications utilizing external pro-
CC
gram 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 pro-
gramming, but must not be driven during
normal 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, pos-
sibly requiring that the controller be iso-
lated from the application circuitry. How
this is done is application dependent
and will be addressed here only in gen-
eral 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
controller, with the buffer outputs three-
stated when programming is enabled.
Alternately, a multiplexer might be used
to select between signal sources, with
signals 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 main-
tained during programming, a latch
might be inserted between the controller
and the application circuitry. The latch is
enabled during programming, preserv-
ing 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
graphically the results of in-circuit repro-
gramming. The text to be displayed is
Microcontroller
8-Bit
Microcontroller
with Flash
Application
Note
0287C
4-9

Advertisement

loading

Summary of Contents for Atmel AT89C51

  • Page 1 How Application ming. A method is then shown by which this is done is application dependent the AT89C51 microcontroller in the ap- and will be addressed here only in gen- Note plication can be reprogrammed re- eral terms.
  • Page 2 Programming requires programmer access to all of the The programmer circuitry consists of an AT89C51 and an four AT89C51 I/O ports, as documented in the data sheet. RS-232 level translator. The controller runs at 11.0592 The programmer is connected directly to those controller...
  • Page 3 CAN to signal the trans- mitter to abort the file transfer. Local Station The simplicity of the FTP reduces the amount of AT89C51 The local station in the test configuration consists of an program memory used in the programmer. The send-and-...
  • Page 4 AT89C51 controller in the application. The load address dem and programmer monitor the phone line for incoming field contains the address at which the data is to be writ- calls.
  • Page 5 Microcontroller It is important to note that invalid packets are NEVER pro- Switch settings: grammed into the application controller. To do so would require that the program memory in the controller be com- pletely erased before the error could be corrected, caus- ing the non-recoverable loss of all previous program data.
  • Page 6 ’PgUp’ key and select ’1’ (External Pro- tocol 1) from the menu of upload protocols. This will exe- cute the ASPECT script associated with External Protocol Figure 1. AT89C51 Moving Display Application Example 10 uF DL1414T EA/VPP P0.0...
  • Page 7 Microcontroller Figure 2. AT89C51 Moving Display Application Modified for In-Circuit Programming 4-15...
  • Page 8 Figure 3. AT89C51 Programmer Microcontroller 4-16...
  • Page 9 Microcontroller Figure 4. FTP Transmit Mode 4-17...
  • Page 10 Figure 5. FTP Receive Mode Microcontroller 4-18...
  • Page 11: Appendix I: Intel Hex File Definition

    Microcontroller The record type field consists of two hex digits, which are Appendix I: Intel Hex File Definition always zero in data records. Hexadecimal object file format (Intel hex) is produced by most 80C51 assembler products. The data field contains from one to 16 pairs of hex digits. Each record in the file contains the following fields: The last two hex digits are a checksum on the record length, load address, record type, and data fields.