in-application programming method – Rainbow Electronics T89C51RD2 User Manual
Page 61
61
Rev. F - 15 February, 2001
T89C51RD2
8.8. In-Application Programming Method
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. The API calls are shown in Table 33.
A set of Philips compatible API calls is provided.
When several bytes have to be programmed, it is highly recommanded to use the ATMEL Wireless and
Microcontrollers API “PROGRAM DATA PAGE” call. Indeed, this API call writes up to 128 bytes in a single
command.
05
Miscellaneous Read Functions
General Format of Function 05
:02xxxx05ffsscc
Where:
02 = number of bytes (hex) in record
xxxx = required field, but value is a “don’t care”
05= “Miscellaneous Read” function code
ffss = subfunction and selection code
0000 = read copy of the signature byte – manufacturer id (58H)
0001 = read copy of the signature byte – device ID# 1 (Family code)
0002 = read copy of the signature byte – device ID # 2 (Memories size and type)
0003 = read copy of the signature byte – device ID # 3 (Product name and revision)
0700 = read the software security bits
0701 = read status byte (BSB)
0702 = read Boot Vector (SBV)
0703 = read copy of the HSB
0800 = read bootloader version
cc = checksum
Example:
:020000050001F0 read copy of the signature byte – device id # 1
Table 33. API calls
API call
Parameter
PROGRAM DATA BYTE
Input Parameters:
R0 = osc freq (integer Not required, left for Philips compatibility)
R1 = 02h
DPTR = address of byte to program
ACC = byte to program
Return Parameter
ACC = 00 if pass, !00 if fail
Table 32. Intel-Hex Records Used by In-System Programming