BL702/704/706 Reference Manual
• Fclk--System master clock
• 32K--32K clock
• 1K--1K clock(32K frequency division)
• Xtal--External crystal
Each counter has its own 8-bit frequency divider. The selected clock can be divided by 1-256 through APB. Specifically,
when it is set to 0, it means no frequency division, and when it is set to 1, it divides it by 2. The maximum frequency
division coefficient is 256, the counter will use the divided clock as the unit of the counting cycle, each time a counting
cycle is increased by one.
13.3.2 General timer operating mode
Each general-purpose timer includes three comparators, a counter and a preload register. When the clock source is
set and the timer is started, the counter starts to count up. When the counter value is equal to the comparator, the
comparison is performed. When the flag is set, a compare interrupt is generated.
The initial value of the counter depends on the timing mode. In FreeRun mode, the initial value of the counter is 0,
and then counts up. When it reaches the maximum value, it starts counting from 0 again.
In PreLoad mode, the initial value of the counter is the value of the PreLoad register and then counts up. When the
PreLoad condition is met, the value of the counter is set to the value of the PreLoad register, and then the counter starts
to count up again. During the counting process, once the value of the counter matches one of the three comparators,
the comparator’s comparison flag will be set and a corresponding comparison interrupt can be generated.
If the value of the preload register is 10, the value of Comparator 0 is 13, the value of Comparator 1 is 16, and the
value of Comparator 2 is 19, the working sequence of the timer in PreLoad mode is as follows:
Timer Counter
Timer Clock
Timer Enable
Comparator 0 flag
Comparator 0 interrupt
Comparator 1 flag
Comparator 1 interrupt
Comparator 2 flag
Comparator 2 interrupt
10 11 12 13 14 15 16 17 18 19 20 10
12 13 14
11
15
Fig. 13.3: Timer Preload
BL702/704/706 Reference Manual 242/ 375
@2021 Bouffalo Lab