21 HW Processor (HWP) and Sound Output
S1C31D50/D51 TECHNICAL MANUAL
Seiko Epson Corporation
21-7
(Rev. 2.00)
FUNCTION.ID[7:0] bits = 0x01 (sound play),
HWPCTL.HWPEN bit = 1
HWPCTL.HWPEN bit = 0
MCU boot up
Sound play function
Sound Star
t
command
ex
ecution
End of pla
ybac
k or
Sound Stop
command
ex
ecution
Sound Stop command
executio
n
End
of pla
ybac
k or
Sound Stop command
ex
ecutio
n
Mute command execution
Release Mute command execution
Pause command execution
Release Pause command execution
sp_state_init
hwp_sleep
sp_state_idle
sp_state_play
sp_state_mute
sp_state_pause
Figure 21.4.1.1 Sound Play State Transition Diagram
As shown in Figure 21.4.1.1, there are six operating states in the sound play function.
1) hwp_sleep
After the MCU boots up, the HWP enters this state (HWPCTL.HWPEN bit = 0). In this state, the clock supply
to the HWP stops. By setting the HWPCTL.HWPEN bit to 1 after configuring the sound play function registers
as shown in “Initialization” above, the HWP transits to sp_state_init state.
2) sp_state_init
After the HWPCTL.HWPEN bit is set to 1, the HWP enters this state and initializes the internal circuit accord-
ing to the settings of the sound play function registers. Upon completion of the initial processing, the HWP
transits to sp_state_idle state.
3) sp_state_idle
This is a standby state in which the sound play function stops playback output. This state allows issuance of
the Sound Start command. After the Sound Start command is issued, the HWP transits to sp_state_play state to
start playback output.
4) sp_state_play
This is the state in which the HWP is performing playback output. This state allows issuance of the Sound Stop,
Pause, or Mute command. When the sound data ends or the Sound Stop command is issued, the HWP stops
playback output and returns to sp_state_idle state. When the Pause command is issued, the HWP transits to sp_
state_pause state to pause playback output. When the Mute command is issued, the HWP transits to sp_state_
mute state to mute the sound.
5) sp_state_pause
This is the state in which the playback output is paused. This state allows issuance of the Release Pause or
Sound Stop command. When the Release Pause command is issued, the HWP transits to sp_state_play state to
resume playback output. When the Sound Stop command is issued, the HWP terminates playback output and
returns to sp_state_idle state.
6) sp_state_mute
This is the state in which the playback output is being continued with the sound muted. This state allows is-
suance of the Release Mute or Sound Stop command. When the Release Mute command is issued, the HWP
transits to sp_state_play state to restore the volume. When the sound data ends or the Sound Stop command is
issued, the HWP terminates playback output and returns to sp_state_idle state.
The current Ch.
n
operating state can be monitored by reading the STATE_
n
.STATE[15:0] bits (except hwp_
sleep). Furthermore, an interrupt can be generated when a state transition to the designated state occurs.