EasyManua.ls Logo

Bouffalo Lab BL702 - Timer Preload

Default Icon
375 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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:
Fig. 13.3: Timer Preload
BL702/704/706 Reference Manual 242/ 375
@2021 Bouffalo Lab
guest@bouffalolab

Table of Contents