Chapter 19 Simple Sound Generator (SSGV1)
S12ZVHY/S12ZVHL Family Reference Manual Rev. 1.05
672
Freescale Semiconductor
19.4.4
SSG Start and Stop
To start SSG, user should set SSGE of SSGCR and config all registers, then set the RDR of SSGCR, the
SSG will start to work.
In run time, when the STP of SSGCR is set, the SSG will stop immediately, all counters will be cleared
(reset to 0). When STP of SSGCR is cleared, SSG will restart if RDR is set. Same for the SSGE of SSGCR,
when clear the SSGE, the SSG will stop immediately, all counters will be cleared (reset to 0). when the
SSGE is set, SSG will restart if RDR is set. Clear the SSGE will disable the SGA and SGT output, so it is
not recommend to use SSGE to stop the SSG.
The RDR of SSGCR can also stop the SSG, when reload occurs while the RDR is cleared, SSG will stop
with all counters cleared, and the interrupt flag (RNDI of SSGIF) will be set. When the RDR is set again,
the SSG will restart. Refer to
.
Exponential attack operation:
SSGAMPB = SSGAMP;
do {
SSGAMPB = SSGAMPB << 1 + 1;
} while (SSGAMPB < AT_buf)
Where : AT_buf is the internal buffer of amplitude threshold register SSGAT.
SSGAMPB = SSGAMP;
do {
SSGAMPB = SSGAMPB >> 1;
} while (SSGAMPB > AT_buf)
Where : AT_buf is the internal buffer of amplitude threshold register SSGAT.
Exponential decay operation: