User`s manual
Engineering Bulletin
EB183 — Rev. 1.0
8 MOTOROLA
STEP2 MOVB #$06,FEECTL ;Set ERAS and set LAT in FEECTL
BRCLR FEECTL,$08,ERROR ;If Vfp not present, output an error
LDAB #$FF
STEP3 STAB FEESTART,X ;Write data to a valid Flash address
STEP4 BSET FEECTL,$01 ;Apply erase voltage (Set ENPE)
STEP5 JSR dly_100ms ;Delay time for erase pulse (Tepulse)
STEP6 BCLR FEECTL,$01 ;Remove erase voltage (Clear ENPE)
STEP7 JSR dly_10ms ;Delay for high voltage turn off (Tverase)
LDAA #$01
CMPA MARGINF ;Is margin flag set??
BNE NOFLAG ;If not, go bump counter and check data
YESFLAG DEC Nep ;Decrement Nep
LDAA #$00
CMPA Nep ;Is Nep=0?
BNE STEP4 ;If not, go to Step 4
JSR READARRY ;Verify entire array is erased
LDAA #$01
CMPA ERASED ;Is the array erased?
BEQ ERROR ;Erase failed, output an error
STEP10 BCLR FEECTL,$02 ;Clear LAT in FEECTL
BRA DONE ;If so, quit.
NOFLAG INC Nep ;Increment number of erase pulses applied
BSR READARRY ;Verify entire array is erased
LDAA #$00
CMPA ERASED ;Is it erased?
BEQ SETMARF ;If so, set margin flag
LDAB Nep
CMPB #MAXNep ;Have we applied max number of pulses?
BLS STEP4 ;If not, continue erasing
BSR ERROR ;If so, we have a problem
SETMARF INC MARGINF ;Set Margin Flag
BRA STEP4
DONE MOVB #$00,$0000 ;Clear Port A
MOVB #$FF,$0002 ;Set DDRA to outputs
MOVB #$02,$0000 ;Turn on PA1 to indicate complete
BRA DONE ;(Turn off Vfp)