![Geehy SEMICONDUCTOR APM32F030x4x6x8xC Скачать руководство пользователя страница 144](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f030x4x6x8xc/apm32f030x4x6x8xc_user-manual_573629144.webp)
www.geehy.com Page 143
Figure 56 Example of Encoder Interface Mode of IC1FP1 Reversed Phase
TI1
TI2
Counter
For example, when TI1 is at low level, and the rising edge of TI2 jumps, the
counter will count down.
Slave Mode
TMR3 timer can synchronize external trigger
Reset mode
Gated mode
Trigger mode
SMFSEL bit in TMRx_SMCTRL register can be set to select the mode
SMFSEL=100 set the reset mode, SMFSEL=101 set the gated mode,
SMFSEL=110 set the trigger mode.
In the reset mode, when a trigger input event occurs, the counter and prescaler
will be initialized, and the rising edge of the selected trigger input (TRGI) will
reinitialize the counter and generate a signal to update the register.
In the gated mode, the enable of the counter depends on the high level of the
selected input. When the trigger input is high, the clock of the counter will be
started. Once the trigger input becomes low, the counter will stop (but not be
reset). The start and stop of the counter are controlled.
In the trigger mode, the enable of the counter depends on the event on the
selected input, the counter is started (but is not reset) at the rising edge of the
trigger input, and only the start of the counter is controlled.
Timer Interconnection
Each timer of TMRx can be connected with each other to realize synchronization
or cascading between timers. It is required to configure one timer in master
mode and the other timer in slave mode.
When the timer is in master mode, it can reset, start, stop and provide clock
source for the counter of the slave mode timer.