English
Language : 

AT89C51RC2-RLRIM Datasheet, PDF (105/127 Pages) ATMEL Corporation – 8-bit Microcontroller with 16K/ 32K Bytes Flash
AT89C51RB2/RC2
API Call Description
Several Application Program Interface (API) calls are available for use by an application
program to permit selective erasing and programming of Flash pages. All calls are made
through a common interface, PGM_MTP. The programming functions are selected by
setting up the microcontroller’s registers before making a call to PGM_MTP at FFF0h.
Results are returned in the registers.
When several Bytes have to be programmed, it is highly recommended to use the Atmel
API “PROGRAM DATA PAGE” call. Indeed, this API call writes up to 128 Bytes in a sin-
gle command.
All routines for software access are provided in the C Flash driver available at Atmel’s
web site.
The API calls description and arguments are shown in Table 74.
Table 74. API Call Summary
Command
R1
A
DPTR0
READ MANUF ID
00h
XXh
0000h
READ DEVICE ID1
READ DEVICE ID2
READ DEVICE ID3
ERASE BLOCK
PROGRAM DATA
BYTE
PROGRAM SSB
PROGRAM BSB
PROGRAM SBV
READ SSB
READ BSB
READ SBV
PROGRAM DATA
PAGE
00h
XXh
0001h
00h
XXh
0002h
00h
XXh
0003h
DPH = 00h
01h
XXh
DPH = 20h
DPH = 40h
02h Vaue to write
Address of
byte to
program
DPH = 00h
DPL = 00h
05h
XXh
DPH = 00h
DPL = 01h
DPH = 00h
DPL = 10h
DPH = 00h
DPL = 11h
06h
New BSB
value
0000h
06h
New SBV
value
0001h
07h
XXh
0000h
07h
XXh
0001h
07h
XXh
0002h
Address of
Number of the first byte
09h
byte to
to program in
program
the Flash
memory
DPTR1
XXh
XXh
XXh
XXh
00h
XXh
00h
XXh
XXh
XXh
XXh
XXh
Address in
XRAM of the
first data to
program
Returned Value
ACC = Manufacturer
Id
ACC = Device Id 1
ACC = Device Id 2
ACC = Device Id 3
ACC = DPH
ACC = 0: DONE
Command Effect
Read Manufacturer identifier
Read Device identifier 1
Read Device identifier 2
Read Device identifier 3
Erase block 0
Erase block 1
Erase block 2
Program up one data byte in the on-chip
flash memory.
Set SSB level 1
ACC = SSB value
Set SSB level 2
Set SSB level 0
Set SSB level 1
none
Program boot status byte
none
ACC = SSB
ACC = BSB
ACC = SBV
ACC = 0: DONE
Program software boot vector
Read Software Security Byte
Read Boot Status Byte
Read Software Boot Vector
Program up to 128 bytes in user Flash.
Remark: number of bytes to program is
limited such as the Flash write remains in a
single 128 bytes page. Hence, when ACC
is 128, valid values of DPL are 00h, or, 80h.
4180E–8051–10/06
105