21.3.3.3 Changing the Period
The Counter period is changed by writing a new TOP value to the Period (TCAn.PER) register.
No Buffering:Any period update is immediate if not using double-buffering.
A counter wrap-around can occur in any mode
of operation when counting up without buffering, as the TCAn.CNT and TCAn.PER registers are
continuously compared. If writing a new TOP value to TCAn.PER lower than the current
TCAn.CNT, the counter will wrap first before a compare match occurs.
With Buffering: When using
double-buffering, the buffer can be written at any time and still maintain the correct
operation. TCAn.PER is always updated on the UPDATE condition, as shown for dual-slope
operation in the figure below. This prevents wrap-around and the generation of odd
waveforms.
Note: Buffering is used in figures illustrating TCA operation if not otherwise
specified.