21 HW Processor (HWP) and Sound Output
S1C31D50/D51 TECHNICAL MANUAL
Seiko Epson Corporation
21-13
(Rev. 2.00)
21.4.2 Memory Check Function
Initialization
Before using the memory check function, initialize the HWP as shown below.
1. Configure the HWP operating clock as necessary. (Refer to “Clock Settings.”)
2. Set the HWPCTL.HWPEN bit to 0.
(Disable HWP)
3. Set the following HWP internal register bits (memory check function register bits):
- Set the FUNCTION.ID[7:0] bits to 0x03.
(Select memory check function)
- INTMASK.TO_PROCESSING bit
(Set check start interrupt mask)
- INTMASK.TO_IDLE bit
(Set check completed/idle state interrupt mask)
4. Set the following bits when using the interrupt:
- Write 1 to the interrupt flags in the HWPINTF register.
(Clear interrupt flags)
- Set the HWPINTE.HWPIE bit to 1.
(Enable interrupts)
5. Set the HWPCTL.HWPEN bit to 1.
(Enable HWP)
6. Wait until the HWPINTF.HWP0IF bit is set to 1 and the STATE.STATE[15:0] bits are set to 0x0001 (mc_
state_idle = memory check function idle state).
Initialize the HWP again if the HWPINTF.HWP1IF bit = 1.
Once the memory check function register bits have been set in Step 3, it is not necessary to set again until they
need to be altered. When altering these register bits, perform the above processing from Step 2.
Memory check state transition
Figure 21.4.2.1 shows the memory check state transition diagram.
FUNCTION.ID[7:0] bits = 0x03 (memory check),
HWPCTL.HWPEN bit = 1
HWPCTL.HWPEN bit = 0
MCU boot up
Memory check function
RAM Chec
k March-C
Star
t command
ex
ecuti
on
Chec
k completed or
Memo
ry
Chec
k Stop command
ex
ecution
mc_state_init
hwp_sleep
mc_state_idle
mc_state
_ram_march_c
RAM Chec
k R/W Star
t command
ex
ecution
Chec
k completed or
Memor
y Chec
k Stop command
ex
ecution
mc_state
_ram_rw
Flash CRC Star
t command
execution
Chec
k completed or
Memo
ry Chec
k Stop
command
execution
mc_state
_crc
Flash Che
ck
sum Star
t command
ex
ecution
Chec
k completed or
Memo
ry
Che
ck
Stop command
ex
ecution
mc_state
_checksum
Figure 21.4.2.1 Memory check State Transition Diagram
As shown in the figure above, there are seven operating states in the memory check function.