User`s manual
Engineering Bulletin
Programming the FLASH Array
EB183 — Rev. 1.0
MOTOROLA 11
Programming the FLASH Array
The following code segment follows the recommended procedure for
programming the FLASH array. Following the code is a flowchart which
outlines this same procedure. The general idea is to apply the
programming voltage to the FLASH module within the chip (by setting
the ENPE bit), set the programming latches, write the desired byte/word
to the location in the array, then check to make sure the location is
programmed properly. If the data is correct, then the number of times the
programming voltage was applied to get this byte programmed will have
been preserved in the N
PP
variable. The programming voltage is then
pulsed that many times again to ensure that the byte/word remains
programmed. This is 100% programming margin. This whole process is
repeated for each byte/word to be programmed. The code segment
below simply copies a string of characters from RAM and stores it at the
beginning of the FLASH array.
NOTE:
In the following code, the STEP labels refer to Section 7.6 of the
MC68HC912B32 Technical Summary (Motorola order number
MC68HC912B32TS/D).
;--------------------------------------------------------
;--- FLASH EEPROM program routine ---
;--- ---
;--- Rev. 1.0 - April 23,1998 ---
;--- Fixed Tppulse = 25µs and Tvprog = 10µs ---
;--- Written November 6, 1997 ---
;--- ---
;--------------------------------------------------------
;-------------- Equates -----------------
FEELCK EQU $F4
FEEMCR EQU $F5
FEECTL EQU $F7
FEESTART EQU $8000 ;FLASH Start address
FEEEND EQU $FFFF ;FLASH End address
MAXNpp EQU !50 ;50 pulses maximum
ORG $0800
Npp DS 1 ;Number of programming pulses applied
MARGINF DS 1 ;Programming margin flag
ORG $80A