AN2183 Freescale Semiconductor / Motorola, AN2183 Datasheet - Page 8

no-image

AN2183

Manufacturer Part Number
AN2183
Description
Using FLASH as EEPROM on the MC68HC908GP32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
EERead
EEErase
8
requirement is 80 bytes. To help avoid assembly language label naming
conflicts, all labels used start with either "EE" or "Ram". The flow
diagrams of these routines (with the exception of the Dump utility, due to
its simplicity) are provided in
The available FlashEE routines are:
This subroutine is called with the 16-bit index register H:X pointing at the
starting address of the desired FlashEE section and the accumulator
preloaded with that FlashEE section’s data block size. The FlashEE
section is sequentially scanned, block by block, until an erased FLASH
byte (i.e., $FF) is found occupying the first location of a data block or the
end of the section is reached.
This subroutine returns with the 16-bit index register H:X pointing to the
first location of the most recent FlashEE data block and the data in that
location stored in the accumulator. The calling routine should check the
accumulator value for $FF to see if any data has been stored in the
FlashEE. Refer to
check should only be needed when an EERead is performed before the
very first EEWrite.
This subroutine is used to erase the contents of a FlashEE section. It is
called with the 16-bit index register H:X pointing at the starting address
of the desired FlashEE section. The value in H:X is returned unchanged.
Regardless of bus frequency, this subroutine will execute in just over
one millisecond. (Specifically, at a bus frequency of 7.3728 MHz, this
subroutine executes in about 1096 s.)
Note that this subroutine will copy and execute a program in RAM. This
is required due to the fact that erasing FLASH locations cannot be
performed by code being executed from the FLASH memory. While
executing code from RAM, all interrupts are disabled.
Freescale Semiconductor, Inc.
For More Information On This Product,
EERead — Read the current valid FlashEE data block
EEErase — Erase an entire FlashEE section
EEWrite — Write a new FlashEE data block
Go to: www.freescale.com
Check_Read
Figure 3
subroutine in the eetest.asm. This
through
Figure
8.
MOTOROLA
AN2183

Related parts for AN2183