Datasheet

707
Sample 32-byte programming program
The wait time set values (number of loops) are for the case where f = 28.7 MHz. For other
frequencies, the set value is given by the following expression:
Wait time (µs) × f (MHz) ÷ 4
Registers Used
R4 (input): Program data storage address
R5 (input): Programming destination address
R7 (output): OK (normal) or NG (error)
R0-3, 8-13: Work registers
FLMCR1 .EQU H’80
FLMCR2 .EQU H’81
OK .EQU H’0
NG .EQU H’1
Wait10u .EQU 72
Wait50u .EQU 359
Wait4u .EQU 29
Wait2u .EQU 14
Wait200u .EQU 1435
WDT_TCSR .EQU H’FFFF8610
WDT_573u .EQU H’A579
SWESET .EQU B’01000000
PSU1SET .EQU B’00010000
P1SET .EQU B’00000001
P1CLEAR .EQU B’11111110
PSU1CLEAR .EQU B’11101111
PVSET .EQU B’00000100
PVCLEAR .EQU B’11111011
SWECLEAR .EQU B’10111111
MAXVerify .EQU 1000
;
FlashProgram .EQU $
MOV #H’01,R2 ; R2 work register (1)
MOV.L #PdataBuff,R0 ; Save program data to work area
MOV R4,R12
MOV #8,R13
COPY_LOOP .EQU $