Output In Melody Mode - Epson S1C31W65 Technical Manual

Cmos 32-bit single chip microcontroller
Table of Contents

Advertisement

Writing to the SNDADAT register
CLK_SNDA
Sound buffer
(SNDADAT register)
Sound register
SNDAINTF.SBSY
SNDAINTF.EMIF
SNDAINTF.EDIF
BZOUT pin
#BZOUT pin
Software operation
Figure 17.4.3.1 Buzzer Output Timing Chart in One-shot Buzzer Mode

17.4.4 Output in Melody Mode

Melody mode generates the buzzer signal with a melody according to the data written to the sound buffer (SNDADAT
register) successively, and outputs the generated signal to outside the IC. An output start procedure and the SNDA
operations are shown below.
Melody output start procedure
1. Set the following SNDASEL register bits:
- Set the SNDASEL.MOSEL[1:0] bits to 0x2.
- SNDASEL.STIM[3:0] bits
2. Write data to the following sound buffer (SNDADAT register) bits. (Start sound output)
- SNDADAT.MDTI bit
- SNDADAT.MDRS bit
- SNDADAT.SLEN[5:0] bits
- SNDADAT.SFRQ[7:0] bits
3. Check to see if the SNDAINTF.EMIF bit is set to 1 (an interrupt can be used).
4. Repeat Steps 2 and 3 until the end of the melody.
Melody output operations
When data is written to the sound buffer (SNDADAT register), SNDA clears the SNDAINTF.EMIF bit (sound
buffer empty interrupt flag) to 0 and starts sound output operations.
The data written to the sound buffer is loaded into the sound register by the internal trigger signal. At the same
time, the SNDAINTF.EMIF bit and SNDAINTF.SBSY bit are both set to 1. The output pin outputs the sound
specified.
The sound output stops if data is not written to the sound buffer (SNDADAT register) until the next trigger is
issued. At the same time, the SNDAINTF.EDIF bit (sound output completion interrupt flag) is set to 1 and the
SNDAINTF.SBSY bit is cleared to 0.
Figure 17.4.4.1 shows a melody mode operation timing chart.
S1C31W65 TECHNICAL MANUAL
(Rev. 1.1)
Writing to the SNDADAT register
Duration specified by the SNDASEL.STIM[3:0] bits
Seiko Epson Corporation
17 SOUND GENERATOR (SNDA)
(When SNDASEL.SINV bit = 0)
(Set melody mode)
(Set tempo)
(Set tie/slur)
(Set note/rest)
(Set duration)
(Set scale)
17-7

Advertisement

Table of Contents
loading

Table of Contents