Specifications

76
3706C–MICRO–2/11
AT89LP3240/6440
13.3.1.1 Normal Mode
The simplest waveform mode is when CP/RL2
=0 and T2CM1-0 = 01B. In this mode the fre-
quency of the output is determined by the TOP value stored in RCAP2L and RCAP2H and
output edges occur at fractions of the timer period. Figure 13-4 shows an example of outputting
two waveforms of the same frequency but different phase by using the toggle on match action.
More complex waveforms are achieved by changing the TOP value and the compare value
s
more frequently.
Figure 13-4. Normal Mode Waveform Example
13.3.1.2 Clear-Timer-on-Compare Mode
Clear-Timer-on-Compare (CTC) mode occurs when the CTCx bit of a compare channel is set to
one. CTC Mode works best when Timer 2 is in capture mode (CP/RL2
=1) to allow the full range
of compare values. In CTC Mode the compare value defines the interval between output events
because the timer is cleared after every compare match. Figure 13-5 shows an example wave-
form using the toggle on match action in CTC Mode.
Figure 13-5. CTC Mode Waveform Example
13.3.1.3 Dual-Slope Mode
The dual-slope mode occurs when CP/RL2
=0 and T2CM
1-0
= 1xB. In this mode the frequency
of the output is determined by the TOP value stored in RCAP2L and RCAP2H and output edges
occur at fractions of the timer period on both the up and down count. Figure 13-6 shows an
example of outputting two symmetrical waveforms using the toggle on match action. More com-
plex waveforms are achieved by changing the TOP value and the compare valu
es more
frequently.
{RCAP2H,RCA2L}
CP/RL2 = 0, T2CM
1-0
= 01B, DCEN = 0
CCA
{CCAH,CCAL}
{CCBH,CCBL}
CCB
CP/RL2 = 1
CCA
{CCAH,CCAL}