Figure 19-5. Period and Compare Double Buffering
Both the TCAn.CMPn and TCAn.CMPnBUF registers are available as I/O registers. This allows
initialization and bypassing of the buffer register and the double buffering function.
19.3.3.3 Changing the Period
The Counter period is changed by writing a new TOP value to the Period register (TCAn.PER).
No Buffering: If double buffering is not used, any period update is immediate.
Figure 19-6. Changing the Period Without Buffering
CNT
A counter wraparound can occur in any mode of operation when up-counting without buffering. This is
due to the fact that the TCAn.CNT and TCAn.PER registers are continuously compared: if a new TOP
value is written to TCAn.PER that is lower than current TCAn.CNT, the counter will wrap first, before a
compare match happens.
Figure 19-7. Unbuffered Dual-Slope Operation
CNT
©
2018 Microchip Technology Inc.
UPDATE
MAX
BOTTOM
New TOP written to
PER that is higher
than current CNT.
MAX
BOTTOM
New TOP written to
PER that is higher
than current CNT.
16-bit Timer/Counter Type A (TCA)
"data write"
"write enable"
EN
BV
CMPnBUF
EN
CMPn
CNT
=
Counter wraparound
New TOP written to
PER that is lower
than current CNT.
Counter wraparound
New TOP written to
PER that is lower
than current CNT.
Datasheet Preliminary
®
megaAVR
0-Series
"match"
"update"
"write"
"update"
"write"
DS40002015A-page 189
Need help?
Do you have a question about the megaAVR 0 Series and is the answer not in the manual?
Questions and answers