Data Sheet

665
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181G–SAM-D21_Datasheet–09/2015
Figure 30-13.Unbuffered Single-Slope Down-Counting Operation
A counter wraparound can occur in any mode of operation when up-counting without buffering, as shown in Figure 30-12.
This due to the fact that COUNT and TOP are continuously compared, and if a new value that is lower than the current
COUNT is written to TOP, COUNT will wrap before a compare match happen.
Figure 30-14.Unbuffered Dual-Slope Operation
When double buffering is used, the buffer can be written at any time and the counter will still maintain correct operation.
The period register is always updated on the update condition, as shown for dual-slope operation in Figure 30-15. This
prevents wraparound and the generation of odd waveforms.
COUNT
MAX
New value written to
PER that is higher
than current COUNT
New value written to
PER that is lower
than current COUNT
"reload" update
"write"
ZERO
COUNT
New value written to
PER that is higher
than current COUNT
New value written to
PER that is lower
than current COUNT
"update"
"write"
Counter Wraparound
MAX
ZERO