AN2156 Freescale Semiconductor / Motorola, AN2156 Datasheet - Page 62

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
***************************************************************************
*****
***************************************************************************
FlashErase:
PAGE_Erase:
62
;-----------------------------------------------------------------;
; Delay Time Evaluation
;
;
;
;-----------------------------------------------------------------;
;-----------------------------------------------------------------;
; Delay Time tNVS Evaluation
;
;-----------------------------------------------------------------;
; Delay Evaluation: Point S1
;
; Delay Evaluation: Point E1
;
;-----------------------------------------------------------------;
; Delay Time tERASE Evaluation
;
;-----------------------------------------------------------------;
; Delay Evaluation: Point S2
;
; Delay Evaluation: Point E2
Initialize Port D bit 3 as output high
bset
bset
sei
ldhx
sta
ora
jsr
lda
lda
sta
Measure low level period on Port D bit 3 pin using a scope
bclr
lda
dbnza *
bset
lda
jsr
brset MASS,temp,MASS_Erase
Measure low level period on Port D bit 3 pin using a scope
bclr
lda
sta
jsr
3,PTD
3,DDRD
FLASH_addr
temp
#erase.
WriteFLCR
fl1bpr
fl2bpr
,X
3,PTD
#$8
3,PTD
#hven.
WriteFLCR
3,PTD
#!1
times
ms_delay
SST FLASH Erase Subroutine
Freescale Semiconductor, Inc.
For More Information On This Product,
;Set Port D bit 3
;Select output for Port D bit 3
;Disable interrupts
;Load the starting address of the area
; to be erased in the HX registers
;Store a value in accumulator to temp
;Step 1 - Set the ERASE bit
; If MASS bit is set, the MASS erase will
; be performed
; If MASS bit is clear, the PAGE erase
; will be performed
;Step 2 - Read from block protect
; registers
;Step 3 - Write to any FLASH address
; within the area address range to be
; erased with any data value
;Clear Port D bit 3
;Step 4 - Wait for time tNVS
; 2 + (3 x 8) cycles = 26 cycles (10.6us)
;Set Port D bit 3
;Step 5 - Set the HVEN bit
;If MASS erase, jump to MASS_Erase
;PAGE Erase
;Clear Port D bit 3
;Step 6 - Wait for time tERASE (1.0ms)
(Time between points S1 and E1)
Go to: www.freescale.com
(Time between points S2 and E2)
*****
;
;
;
;
;
;
;
;
MOTOROLA
AN2156

Related parts for AN2156