W78E365/W78E365A
Part 2: 4KB LDROM
Go
Procedure of Updating
the 32KB APROM
Timer Interrupt Service Routine:
Stop Timer & disable interrupt
PGM
Yes
Yes
Is F04KBOOT Mode?
(CHPCON.7=1)
End of Programming ?
No
No
Reset the CHPCON Register:
MOV CHPENR,#87H
MOV CHPENR,#59H
MOV CHPCON,#03H
Setting Timer and enable Timer
interrupt for wake-up .
(50us for program operation)
Yes
Is currently in the
F04KBOOT Mode ?
No
Software reset CPU and
re-boot from the 32KB
APROM.
Get the parameters of new code
(Address and data bytes)
Setting Timer and enable Timer
interrupt for wake-up .
(15 ms for erasing operation)
through I/O ports, UART or
other interfaces.
MOV CHPENR,#87H
MOV CHPENR,#59H
MOV CHPCON,#83H
Setting erase operation mode:
MOV SFRCN,#22H
(Erase 32KB APROM)
Setting control registers for
programming:
Hardware Reset
to re-boot from
new 32 KB APROM.
(S/W reset is
invalid in F04KBOOT
Mode)
MOV SFRAH,#ADDRESS_H
MOV SFRAL,#ADDRESS_L
MOV SFRFD,#DATA
Start Timer and enter IDLE
Mode.
MOV SFRCN,#21H
(Erasing...)
End of erase
operation. CPU will
be wakened by Timer
interrupt.
END
Executing new code
from address
00H in the 32KB APROM.
PGM
- 24 -