Application programming interface, Application remarks – Rainbow Electronics AT89C5131 User Manual
Page 58

58
AT89C5131
4136A–USB–03/03
Application
Programming Interface
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
by functions.
All these APIs will be described in an application note.
Application Remarks
•
A user bootloader can be mapped at address [SBV]00h. The byte SBV contains the
high byte of the boot address, and can be read and written by API.
•
The API can be called during user application, without disabling interrupt.
The interrupts are disabled by some APIs, for complex operations.
API Call
Description
PROGRAM DATA BYTE
Write a byte in Flash memory
PROGRAM DATA PAGE
Write a page (128 bytes) in Flash memory
PROGRAM EEPROM BYTE
Write a byte in EEPROM memory
ERASE BLOCK
Erase all Flash memory
ERASE SW BOOT VECTOR (SBV)
Erase the software boot vector
PROGRAM SW BOOT VECTOR (SBV)
Write the software boot vector
ERASE HW BOOT VECTOR (HBV)
Erase the hardware boot vector
PROGRAM HW BOOT VECTOR (HBV)
Write the hardware boot vector
PROGRAM EXTRA BYTE (EB)
Write the extra byte
READ DATA BYTE
READ EEPROM BYTE
READ FAMILY CODE
READ MANUFACTURER CODE
READ PRODUCT NAME
READ REVISION NUMBER
READ STATUS BIT (BSB)
Read the status bit
READ BOOT VECTOR (SBV)
Read the boot vector
READ EXTRA BYTE (EB)
Read the extra byte
PROGRAM X2
Write the hardware flag for X2 mode
READ X2
Read the hardware flag for X2 mode
PROGRAM BLJB
Write the hardware flag BLJB
READ BLJB
Read the hardware flag BLJB