Sound Generation Logic (SGL)
MPC5606S Microcontroller Reference Manual, Rev. 7
1116 Freescale Semiconductor
 
In case the user needs to control the sound duration through software, then SOUND_CTRL[1] needs to be 
set to 1. SOUND_CTRL[1] can be forced to 0 at any point of time by software through the IPS interface 
if the sound generation needs to be stopped. This feature handles the case in which sound generation needs 
to be stopped after a time that cannot be predetermined. An example of this is the warning sound that 
should be generated when a car door is left open, which should stop as soon as the car door is closed. The 
sound generation continues as long as SOUND_CTRL[1] is 1 (that is, when the car door is open) and stops 
as soon as it is set to zero (when the car door is closed).
NOTE
While the sound is active, it is not possible to stop the sound immediately 
by setting SOUND_CTR
 = 0 (no sound generation). The current 
programmed duration of the sound must complete before the sound can be 
stopped. 
Table 34-10. Truth table for MODE_SEL[SOUND_CTRL] 
SOUND_
CTRL[2]
(Periodic/
Continuous)
SOUND_
CTRL[1]
(Begin/End)
SOUND_
CTRL[0]
(Counter 
Enable)
Result 
X 0 0 No sound generation
0 0 1 Continuous sound is generated until the counter loaded with the 
value in the SOUND_DURATION register reaches 0.
There is no dependency on HIGH_PERIOD and LOW_PERIOD 
register values.
0 1 X Continuous sound is generated.
There is no dependency on SOUND_DURATION, HIGH_PERIOD, 
or LOW_PERIOD register values.
1 0 1 Sound High (i.e. Sound is on) and Sound Low (i.e. sound is off) are 
generated until the counter loaded with the value in the 
SOUND_DURATION register reaches 0.
Duration for Sound High and Sound Low depend on HIGH_PERIOD 
and LOW_PERIOD_MSB Register values respectively.
The HIGH_PERIOD counter and LOW_PERIOD counter are 
reloaded automatically as long as the SOUND_DURATION counter 
does not reach 0.
1 1 X Sound High (i.e. Sound is on) and Sound Low (i.e. sound is off) are 
generated.
Duration for Sound High and Sound Low depend on HIGH_PERIOD 
and LOW_PERIOD Register values respectively.
The HIGH_PERIOD counter and LOW_PERIOD counter are 
reloaded automatically.
There is no dependency on the value in the SOUND_DURATION 
register in this mode.