![Geehy SEMICONDUCTOR APM32F405 Series Скачать руководство пользователя страница 165](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f405-series/apm32f405-series_user-manual_573630165.webp)
www.geehy.com Page 164
External clock mode 1
The trigger signal generated from the input channel TI1/2/3/4 of the timer after
polarity selection and filtering is connected to the slave mode controller to
control the work of the counter. Besides, the pulse signal generated by the input
of Channel 1 after double-edge detection of the rising edge and the falling edge
is logically equal or the future signal is TI1F_ED signal, namely double-edge
signal of TIF_ED. Specially the PWM input can only be input by TI1/2.
External clock mode 2
After polarity selection, frequency division and filtering, the signal from external
trigger interface (ETR) is connected to slave mode controller through trigger
input selector to control the work of counter.
Internal trigger input
The timer is set to work in slave mode, and the clock source is the output signal
of other timers. At this time, the clock source has no filtering, and the
synchronization or cascading between timers can be realized. The master mode
timer can reset, start, stop or provide clock for the slave mode timer.
Timebase unit
The time base unit in the advanced timer contains four registers
16-bit counter register (CNT)
16-bit auto reload register (AUTORLD)
16-bit prescaler register (PSC)
8-bit repetition count register (REPCNT)
Repetition register is unique to advanced timer.
Counter CNT
There are three counting modes for the counter in the advanced timer
Count-up mode
Count-down mode
Center-aligned mode
Count-up mode
Set to the count-up mode by CNTDIR bit of configuration control register
(TMRx_CTRL1).
When the counter is in count-up mode, the counter will count up from 0; every
time a pulse is generated, the counter will increase by 1 and when the value of
the counter (TMRx_CNT) is equal to the value of the auto reload
(TMRx_AUTORLD), the counter will start to count again from 0, a count-up
overrun event will be generated, and the value of the auto reload