16 SOUND GENERATOR (SNDA)
16-4
Seiko Epson Corporation
S1C17M20/M21/M22/M23/M24/M25
TECHNICAL MANUAL (Rev. 1.0)
2. Write data to the following sound buffer (SNDDAT register) bits.
(Start buzzer output)
- SNDDAT.SLEN[5:0] bits
(Set buzzer output signal duty ratio)
- SNDDAT.SFRQ[7:0] bits
(Set buzzer output signal frequency)
3. Write 1 to the SNDCTL.SSTP bit after the output period has elapsed. (Stop buzzer output)
Normal buzzer output operations
When data is written to the sound buffer (SNDDAT register), SNDA clears the SNDINTF.EMIF bit (sound buf-
fer empty interrupt flag) to 0 and starts buzzer output operations.
The data written to the sound buffer is loaded into the sound register in sync with the CLK_SNDA clock. At
the same time, the SNDINTF.EMIF bit and SNDINTF.SBSY bit are both set to 1. The output pin outputs the
buzzer signal with the frequency/duty ratio specified.
Writing 1 to the SNDCTL.SSTP bit stops buzzer output and sets the SNDINTF.EDIF bit (sound output comple-
tion interrupt flag) to 1. The SNDINTF.SBSY bit is cleared to 0.
Figure 16.4.2.1 shows a buzzer output timing chart in normal buzzer mode.
CLK_SNDA
Sound buffer
(SNDDAT register)
Sound register
SNDCTL.SSTP
SNDINTF.SBSY
SNDINTF.EMIF
SNDINTF.EDIF
BZOUT pin
#BZOUT pin
Writing to the SNDDAT register
Writing to the SNDDAT register
Software operation
(When SNDSEL.SINV bit = 0)
SSTP = 1
Figure 16.4.2.1 Buzzer Output Timing Chart in Normal Buzzer Mode
Buzzer output waveform configuration (normal buzzer mode/one-shot buzzer mode)
Set the buzzer signal frequency and duty ratio (high period/cycle) using the SNDDAT.SFRQ[7:0] and SND-
DAT.SLEN[5:0] bits, respectively. Use the following equations to calculate these setting values.
f
CLK_SNDA
SNDDAT.SFRQ[7:0] bits = ————— -1
(Eq. 16.1)
f
BZOUT
f
CLK_SNDA
DUTY
SNDDAT.SLEN[5:0] bits =
(
—————
×
————
)
-1
(Eq. 16.2)
f
BZOUT
100
Where
f
CLK_SNDA
: CLK_SNDA frequency [Hz]
f
BZOUT
:
Buzzer signal frequency [Hz]
DUTY:
Buzzer signal duty ratio [%]
However, the following settings are prohibited:
• Settings as SNDDAT.SFRQ[7:0] bits
≤
SNDDAT.SLEN[5:0] bits
• Settings as SNDDAT.SFRQ[7:0] bits = 0x00