Chapter 19 Simple Sound Generator (SSGV1)
S12ZVHY/S12ZVHL Family Reference Manual Rev. 1.05
670
Freescale Semiconductor
•
In linear attack operation SSGAMPB (SSGAMP’s buffer) will be increased by SSGAA every
SSG 1 tone cycle. In linear decay operation, SSGAMPB will be decreased by SSGAA
every 1 tone cycle. See below linear attack/decay formula.
•
In gong attack operation SSGAMPB will be increased by SSGAMPB/32 every 1 tone
cycle. In gong decay operation SSGAMPB will be decreased by SSGAMPB/32 every
1 tone cycle. See below gong attack/decay formula.
•
In exponential attack operation SSGAMPB will multiply with 2 then add 1 every 1
tone cycle. In exponential decay operation, SSGAMPB will be divided by 2 every 1
tone cycle. See below exponential attack/decay formula.
Linear attack operation:
do{
SSGAMPB = S SSGAA_buf;
} While (SSGAMPB < AT_buf)
Where : AT_buf is the internal buffer of amplitude threshold register SSGAT.
SSGAMPB = SSGAMP;
Linear decay operation:
Where : AT_buf is the internal buffer of amplitude threshold register SSGAT.
} While (SSGAMPB > AT_buf)
SSGAMPB = SSGAMPB - SSGAA_buf;
do{
SSGAMPB = SSGAMP;
SSGAA_buf is the internal buffer of SSGAA.
SSGAA_buf is the internal buffer of SSGAA.