User`s manual
Engineering Bulletin
EB183 — Rev. 1.0
12 MOTOROLA
START LDS #$B00 ;(Turn on your Vfp power supply to board)
BRCLR FEECTL,$08,ERROR ;If Vfp not present, output an error
LDX #$0000
LOOP CLR Npp ;Clear number of pulses
CLR MARGINF ;Clear margin flag
STEP2 MOVB #$02,FEECTL ;Clear ERAS and set LAT in FEECTL
LDAB DATA,X
STEP3 STAB FEESTART,X ;Write data to address
STEP4 BSET FEECTL,$01 ;Apply programming voltage (Set ENPE)
STEP5 JSR dly_22us ;Delay time for prog pulse (Tppulse)
STEP6 BCLR FEECTL,$01 ;Remove programming voltage (Clear ENPE)
STEP7 JSR dly_10us ;Delay for high voltage turn off (Tvprog)
LDAA #$01
CMPA MARGINF ;Is margin flag set??
BNE NOFLAG ;If not, go bump counter and check data
YESFLAG DEC Npp ;Decrement Npp
LDAA #$00
CMPA Npp ;Is Npp=0?
BNE STEP4 ;If not, go to Step 4
STEP9 LDAA FEESTART,X ;Read FEEPROM location to verify programming
CMPA DATA,X ;Is it the same as the byte to be programmed?
BNE ERROR ;Programming failed, output an error
STEP10 BCLR FEECTL,$02 ;Clear LAT in FEECTL
INX
CMPA #$00 ;Check to see if we're done
BNE LOOP ;If not, go back to start!
BRA DONE ;If so, quit.
NOFLAG INC Npp ;Increment number of prog pulses applied
LDAA FEESTART,X ;Read FEEPROM location to verify programming
CMPA DATA,X ;Is it the same as the byte to be programmed?
BEQ SETMARF ;If so, set the margin flag
LDAB Npp
CMPB #MAXNpp ;Have we applied max number of pulses?
BLS STEP4 ;If not, continue programming
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 * ;(Turn off Vfp supply - programming complete)