AN2156 Freescale Semiconductor / Motorola, AN2156 Datasheet - Page 66

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
ProgRow_End:
***************************************************************************
*****
***************************************************************************
* This routine determines whether flcr1 or flcr2 should be written to and *
* which bit(s) in the flcr is set or clear based on the accumulator value *
* and the Flash address specified by FLASH_addr.
* Initializations required:
*
*
*
* Values returned:
*
***************************************************************************
WriteFLCR:
66
;-----------------------------------------------------------------;
; Delay Time tNVH Evaluation
;
;-----------------------------------------------------------------;
; Delay Evaluation: Point S11
;
; Delay Evaluation: Point E11
;
;-----------------------------------------------------------------;
; Delay Time tRCV Evaluation
;
;-----------------------------------------------------------------;
; Delay Evaluation: Point S12
;
; Delay Evaluation: Point E12
;
- Set bit(s) in accumulator for making bit(s) in the flcr set or
- Load FLASH_addr to HX registers
- None
; Delay Evaluation: Point E10_2
clear
lda
jsr
Measure low level period on Port D bit 3 pin using a scope
bclr
lda
dbnza *
bset
lda
jsr
Measure low level period on Port D bit 3 pin using a scope
bclr
aix
sthx
bset
cli
rts
cphx
bhs
eor
sta
#pgm.
WriteFLCR
3,PTD
#$4
3,PTD
#hven.
WriteFLCR
3,PTD
#$1
FLASH_addr
3,PTD
#flash-1
Array1
fl2cr
fl2cr
Write to FLASH Control Register
Freescale Semiconductor, Inc.
For More Information On This Product,
;Step 10 - Clear the PGM bit
;Clear Port D bit 3
;Step 11 - Wait for time tNVH
; 2 + (3 x 4) cycles = 14 cycles (5.7us)
;Set Port D bit 3
;Step 12 - Clear the HVEN bit
;Clear Port D bit 3
;Step 13 - Wait for time tRCV
; 2 + 4 cycles = 6 cycles (2.4us)
;Point the next address in FLASH_addr
;Set Port D bit 3
;Clear the interrupt mask bit and return
;If FLASH_addr is in Flash-1 array,
; jump to Array1
;Write to fl2cr register
(Time between points S11 and E11)
(Time between points S12 and E12)
Go to: www.freescale.com
;
;
;
;
*****
*
*
*
*
*
*
*
MOTOROLA
AN2156

Related parts for AN2156