CHAPTER 18:Sound Generator
424
S6J3200 Series Hardware Manual Document Number: 002-04852 Rev. *G
(1) Set the information to control the Sound Generator to the Sound Control Register (SGCR) by software.
Initialize the Interrupt status bit (SGCR.INT) and set the Interrupt enable bit (SGCR.INTE).
(2) Set registers "Amplitude Data Register (SGAR)", "Frequency Data Register (SGFR)", "Tone Output
Number Register (SGNR)", "Time Cycle Register (SGTCR)", "Increase and Decrease Data Register
(SGIDR)" and "PWM Cycle Data Register (SGPCR)" by software. (*1: Set only the necessary registers.)
(3) Write "1" to the Start bit (SGCR.ST).
(4) The outputs of SGO and SGA start.
(5) The Tone pulse counter counts the number of tone pulses. When the following conditions are satisfied,
the interrupt is generated.
-
Tone pulse counter is 0x00
-
Decrement counter is 0x00
-
At the rising edge of SGO
(6) MCU clears the interrupt.
(7) Set registers "Amplitude Data Register (SGAR)", "Frequency Data Register (SGFR)", "Tone Output
Number Register (SGNR)", "Time Cycle Register (SGTCR)", "Increase and Decrease Data Register
(SGIDR)" and "PWM Cycle Data Register (SGPCR)" by software. (*1: Set only the necessary registers.)
(8) The Sound Generator keeps outputting SGO and SGA, according to the register settings above.
(9) The Tone pulse counter counts the number of tone pulses. When the following conditions are satisfied,
the interrupt is generated.
-
Tone pulse counter is 0x00
-
Decrement counter is 0x00
-
At the rising edge of SGO
(10) MCU clears the interrupt.
(11) Repeat the flow from 7 to 11 to continue outputting the sound.
(12) Software writes "0" to the Start bit (SGCR.ST) to stop outputting the sound.
Notes:
−
The software must finish the procedure from step 5 to 7, within the following time.
The limit time = (Frequency Data Register [SGFR] + 1) x 1 PWM cycle
−
In case of switching the selection of increase/decrease, it is needed to write "Increase/decrease
setting bit (SGCR.GID)" and the "Automatic increase/decrease enable bit (SGCR.GEN)" in the
Sound Control Register (SGCR) within above-mentioned limit time.
Summary of Contents for S6J3200 Series
Page 1041: ...CHAPTER 28 LCD Controller 1040 S6J3200 Series Hardware Manual Document Number 002 04852 Rev G...
Page 1044: ...CHAPTER 28 LCD Controller S6J3200 Series Hardware Manual Document Number 002 04852 Rev G 1043...
Page 1047: ...CHAPTER 28 LCD Controller 1046 S6J3200 Series Hardware Manual Document Number 002 04852 Rev G...
Page 1050: ...CHAPTER 28 LCD Controller S6J3200 Series Hardware Manual Document Number 002 04852 Rev G 1049...
Page 1084: ...CHAPTER 28 LCD Controller S6J3200 Series Hardware Manual Document Number 002 04852 Rev G 1083...
Page 1086: ...CHAPTER 28 LCD Controller S6J3200 Series Hardware Manual Document Number 002 04852 Rev G 1085...
Page 1088: ...CHAPTER 28 LCD Controller S6J3200 Series Hardware Manual Document Number 002 04852 Rev G 1087...