To understand the three counter modes consider Figure 10.2. In these
examples, we assume a prescaler of 1 (counter clock is half the internal clock),
and a auto reload value of 3. Notice that in “Up” mode, the counter increments from 0 to 3 (ARR) and then is reset to 0. When the reset occurs, an “update
event” is generated. This update event may be tied to TRGO, or in more
complex timers with capture/compare channels it may have additional effects
(described below). Similarly, in “Down” mode, the counter decrements from 3
to 0 and then is reset to 3 (ARR). In Down mode, an update “event” (UEV)
is generated when the counter is reset to ARR. Finally, in Up/Down mode,
the counter increments to ARR, then decrements to 0, and repeats. A UEV
is generated before each reversal with the effect that the period in Up/Down
mode is one shorter than in either Up or Down mode