SN8P2977
8-Bit Micro-Controller with Regulator, PGIA, 24-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 103
Version 1.7
12.4 ISP ROM ROUTINE EXAMPLE
Example : ISP Example with Internal VPP generation:
ISP ROM Address from 0x0700H to 0x0703H (4-words)
Using Macro
“RomwrtVpp”.
Start:
MOV
A, #32
B0MOV
ISP_Cnt,A
@ISP_WRITE:
;====================== Set ISP Address ======================
----------- Start Address = 0x01F0h------------
MOV
A, #0F0H
B0MOV
ROMADRL,A
;Move Low Byte Address to ROMADRL
MOV
A,#01H
B0MOV
ROMADRH,A
;Move High Byte Address to ROMADRH
;====================== Load data for ISP ======================
@@:
MOV
A, #12H
Data = 0x1234
B0MOV
ROMDAH,A
MOV
A, #34H
B0MOV
ROMDAL,A
;=============== ISP Write, Using Macro “RomwrtVpp ===============
B0BCLR
FGIE
; Disable Interrupt.
RomwrtVpp
; ISP ROM Write Macro Instruction
B0BSET
FGIE
; Enable Interrupt if necessary.
Incms
ROMADRL
;ISP Address increase
jmp
$+2
incms
ROMADRH
nop
decms
ISP_Cnt
;Data counter
jmp
@b
ISP_End:
jmp
$
End of ISP