AN2156 Freescale Semiconductor / Motorola, AN2156 Datasheet - Page 68

no-image

AN2156

Manufacturer Part Number
AN2156
Description
Programming and Erasing FLASH and EEPROM Memories on the MC68HC908AS60A/AZ60A
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
Standard EEPROM Assembly Source Code Flowcharts
68
The main routine EEPROM.mrt initializes the device for erasing and
programming operations. It sets up the clock source and timebase
divider for the EEPROM memory and specifies the value and the
location to be programmed. The routine then performs the EEPROM
erase and program operations by calling EEPROMroutine twice.
The EEPROMroutine subroutine follows the flowcharts that are shown
in
WriteEECR subroutine which is used to set or clear various bits in the
EExCR registers and ms_delay subroutine which generates delays
greater than 1 millisecond.
The flowcharts for EEPROM.mrt, EEPROMroutine.mrt, WriteEECR
and ms_delay are
respectively.
Figure 13
Note:
If proper values have been programmed to EExDIVHNVR
and EExDIVLNVR, this step is not necessary.
Freescale Semiconductor, Inc.
TO SET EEPROM TIMEBASE DIVIDER,
WRITE PROPER VALUES TO EExDIVH
For More Information On This Product,
STORE ONE BYTE DATA TO RAM
ADDRESS INTO EEPROM_addr
Figure 21. Standard EEPROM Main Routine Flowchart
LOAD SELECTED EEPROM
AND EExDIVL (See Note)
DISABLE COP
DATA BUFFER
EEPROM.mrt
ENABLE LVI
Go to: www.freescale.com
and
Figure 14
Figure
21,
closely. Flowcharts are also included for the
Figure
22,
Figure
LOAD byteerase, blockerase, OR bulkerase
LOAD byteprogram TO ACCUMULATOR
CALL EEPROMroutine TO
TO PROGRAM EEPROM
CALL EEPROMroutine
TO ACCUMULATOR
ERASE EEPROM
23, and
END
Figure
MOTOROLA
AN2156
24,

Related parts for AN2156