Output In Melody Mode - Epson S1C17W12 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

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

16.4.4 Output in Melody Mode

Melody mode generates the buzzer signal with a melody according to the data written to the sound buffer (SNDDAT
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 SNDSEL register bits:
- Set the SNDSEL.MOSEL[1:0] bits to 0x2.
- SNDSEL.STIM[3:0] bits
2. Write data to the following sound buffer (SNDDAT register) bits. (Start sound output)
- SNDDAT.MDTI bit
- SNDDAT.MDRS bit
- SNDDAT.SLEN[5:0] bits
- SNDDAT.SFRQ[7:0] bits
3. Check to see if the SNDINTF.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 (SNDDAT register), SNDA clears the SNDINTF.EMIF bit (sound buf-
fer 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 SNDINTF.EMIF bit and SNDINTF.SBSY bit are both set to 1. The output pin outputs the sound spec-
ified.
The sound output stops if data is not written to the sound buffer (SNDDAT register) until the next trigger is
issued. At the same time, the SNDINTF.EDIF bit (sound output completion interrupt flag) is set to 1 and the
SNDINTF.SBSY bit is cleared to 0.
Figure 16.4.4.1 shows a melody mode operation timing chart.
S1C17W12/W13 TECHNICAL MANUAL
(Rev. 1.2)
Writing to the SNDDAT register
Duration specified by the SNDSEL.STIM[3:0] bits
Seiko Epson Corporation
16 SOUND GENERATOR (SNDA)
(When SNDSEL.SINV bit = 0)
(Set melody mode)
(Set tempo)
(Set tie/slur)
(Set note/rest)
(Set duration)
(Set scale)
16-7

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17w13

Table of Contents