AT89C51RC2_FLIP_Programming_Guide
AT89C51RC2_FLIP_Programming_Guide
In order to program the AT89C51RC2 using FLIP, the processor needs to execute the on-chip
bootloader code. The bootloader can be activated by two methods (hardware conditions or
regular boot process), as explained on page 93 of the AT89C51RC2 data sheet and in the Atmel
application note "C51 General Information about Bootloader and in System Programming".
In order to execute the bootloader using hardware conditions, the /EA pin must be high and the
/PSEN pin must be low at the falling edge of the reset signal. /PSEN must be released after the
falling edge of the reset signal, since /PSEN is normally an output that is driven by the processor.
This configuration will forcibly place the AT89C51RC2 in serial programming mode. After
reset, the Flip software can be started or set up for RS-232 communication and will connect to
the bootloader in the processor.
1
Programming Using Flip
The AT89C51RC2 can be programmed via the RS-232 serial interface using the Atmel FLIP
software. Flip can be freely downloaded from:
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
Step 1: Start FLIP. Note that extensive help is available from within FLIP.
Step 2: Select device AT89C51RD2 for the Atmel AT89C51RC2 controller. The Atmel
AT89C51RC2 controller is not listed in the Flip device selection list. See the figure below.
Step 3: Click communication icon or (settings -> Communication) and select RS-232 for
setup. Select appropriate baud rate and comport for hardware and then press Connect.
(Highest baud rate supported is 57600).
If the AT89C51RC2 is in programming mode (executing the bootloader), then it will enable
the programming options; otherwise, it will give a time out error. Make sure that the device is
properly configured in serial programming mode by making /EA = 1 and /PSEN = 0 when
the processor comes out of reset.
2
Step 4: Load hex file. On loading, the hex file name will be displayed in the center under
flash buffer information along with size of it. Then, perform Erase, Blank Check, Program
and Verify cycles.
Note: Blank check may fail at address 0xF800 since it is reserved for the boot ROM and
erasing flash will set the default value for HSB and BSB. (For more information about the
HSB (Hardware Security Byte), read AT89C51RC2 datasheet page 87). You can ignore this
error due to blank check.
Step 5: After successful programming, the user application can be tested by pressing the red
“Start Application” button. This will place the device in normal mode and then the user
program will run normally. (Do not tie /PSEN low during execution, even if it is executing
from internal memory. Configure /PSEN as either floating or output pin before pressing
“Start Application”).
3
Jumper Configuration for AT89C51RC2:
The AT89C51RC2 can be programmed serially through RS-232 port without physically
removing it from circuit. In order to program AT89C51RC2 chip, it is required to switch its
mode to programming mode. The AT89C51RC2 samples the status of the /PSEN and /EA pin on
falling edge of reset and if /EA and /PSEN are tied to VCC and GND respectively on power on
reset then it places chip in the programming mode. /PSEN and /EA pins can be configured using
pushbuttons or a set of jumpers. The following diagram shows the jumper settings:
AT89C51 Jumper 2
1
VCC_BAR
2
B) FLIP PROGRAMMING MODE: Both the jumpers are in position 2 at falling edge of
reset. /PSEN is then released after reset, so that it can operate normally. Use 1K current
limiting resistor for /PSEN pull-down.
U1
39 21
38 P0.0/AD0 P2.0/A8 22
37 P0.1/AD1 P2.1/A9 23
36 P0.2/AD2 P2.2/A10 24
35 P0.3/AD3 P2.3/A11 25
34 P0.4/AD4 P2.4/A12 26
33 P0.5/AD5 P2.5/A13 27
32 P0.6/AD6 P2.6/A14 28
P0.7/AD7 P2.7/A15
1 10
2 P1.0 P3.0/RXD 11
3 P1.1 P3.1/TXD 12
4 P1.2 P3.2/INT0 13
5 P1.3 P3.3/INT1 14 1
6 P1.4 P3.4/T0 15 7408 3 To EPROM
7 P1.5 P3.5/T1 16 2
8 P1.6 P3.6/WR 17
P1.7 P3.7/RD
19 30 1
18 XTAL1 ALE/PROG 29 1K
XTAL2 PSEN 2
31
9 EA/VPP Jumper 1 OR Switch Pulldown resistor
RST
AT89C51
1
VCC_BAR
2
Jumper 2