EM6621
7.1.1 Single Run Mode
The RegMelPeri value and the selected timer frequency in RegMelTim control the timer duration. The timer is
counting down from its previously charged value until it reaches 0. On 0 the timer stops and generates an
interrupt request. The buzzer frequency output is enabled after the next positive timer clock edge and remains
enabled until the timer reaches 0.
Figure 20. Single Run Mode
Tim er Clock
Tim er Value
2
1
0
1
0
Buzzer
IRQBz
µP writes 2 into
RegMelPeri
µP writes 1 into
RegMelPeri
7.1.2 Continuos Run Mode
This is almost the same as the single run mode only that in this case the timer after reaching 0 reloads itself
automatically with the register
RegMelPeri
value. Every time the timer reaches 0 an interrupt request is send.
There are 2 ways to stop the continuos mode.
•
First, changing the mode to single run mode. As the timer reaches 0 it stops. The last period after
Auto=0
is
of length
RegMelPeri + 1.
•
Second, loading 0 into the timer period register
RegMelPeri
stops the timer immediately, no interrupt is
generated and the
Auto
flag is reset. The buzzer frequency output is enabled directly by writing
Auto=1.
Figure 21. Continuos Run Mode
Timer Clock
Timer Value
2
1
0
2
1
0
2
1
0
Buzzer
IRQBz
µP writes 2
into
RegMelPeri
µP writes
Auto = 1
n periods
n+1 periods
µP writes
Auto = 0
©
EM Microelectronic-Marin SA, 03/99, Rev. B/
03/02 REV. D/444
Copyright
2002, EM Microelectronic-Marin SA
28
www.emmicroelectronic.com