Chapter 19 Simple Sound Generator (SSGV1)
S12ZVHY/S12ZVHL Family Reference Manual Rev. 1.05
Freescale Semiconductor
671
Gong attack operation:
AMP_int = {SSGAMPB, 5’b00000};
do{
AMP_int = A (AMP_int >> 5);
SSGAMPB = AMP_int >> 5;
} While (SSGAMPB < AT_buf)
AT_buf is the internal buffer of amplitude threshold register SSGAT.
where : AMP_int is a 16 bit internal register.
SSGAMPB = SSGAMP;
Gong decay operation:
AMP_int = {SSGAMPB, 5’b11111};
SSGAMPB = SSGAMP;
do{
AMP_int = AMP_int - (AMP_int >> 5);
SSGAMPB = AMP_int >> 5;
} While (SSGAMPB > AT_buf)
AT_buf is the internal buffer of amplitude threshold register SSGAT.
where : AMP_int is a 16 bit internal register.