Datasheet

126
AT89C51IC2
4301D–8051–02/08
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 93.
Table 93. API Call Summary
Command R1 A DPTR0 DPTR1 Returned Value Command Effect
READ MANUF ID 00h XXh 0000h XXh
ACC = Manufacturer
Id
Read Manufacturer identifier
READ DEVICE ID1 00h XXh 0001h XXh ACC = Device Id 1 Read Device identifier 1
READ DEVICE ID2 00h XXh 0002h XXh ACC = Device Id 2 Read Device identifier 2
READ DEVICE ID3 00h XXh 0003h XXh ACC = Device Id 3 Read Device identifier 3
ERASE BLOCK 01h XXh
DPH = 00h
00h ACC = DPH
Erase block 0
DPH = 20h Erase block 1
DPH = 40h Erase block 2
Address of
byte to
program
Program one Data Byte in user Flash
XXh
Erase Software boot vector and boot status
byte. (SBV = FCh and BSB = FFh)
PROGRAM SSB 05h XXh
DPH = 00h
DPL = 00h
00h ACC = SSB value
Set SSB level 1
DPH = 00h
DPL = 01h
Set SSB level 2
DPH = 00h
DPL = 10h
Set SSB level 0
DPH = 00h
DPL = 11h
Set SSB level 1
PROGRAM BSB 06h
New BSB
value
0000h XXh none Program boot status byte
PROGRAM SBV 06h
New SBV
value
0001h XXh none Program software boot vector
READ SSB 07h XXh 0000h XXh ACC = SSB Read Software Security Byte
READ BSB 07h XXh 0001h XXh ACC = BSB Read Boot Status Byte
READ SBV 07h XXh 0002h XXh ACC = SBV Read Software Boot Vector