Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
238
/
631
Figure 11-10 Control circuit in external clock mode 1
External clock source mode 2
This mode is selected by TIMx_SMCTRL .EXCEN equal to 1. The counter can count on every rising or falling edge
of the external trigger input ETR.
The following figure is a schematic diagram of the external trigger input module in External clock source mode 2
Figure 11-11 External trigger input block diagram
For example, use the following configuration steps to make the up counter count every 2 rising edges on ETR.
Since no filter is needed in this case, make TIMx_SMCTRL .EXTF[3:0] equal to ‘0000’
Configure the prescaler by making TIMx_SMCTRL.EXTPS[1:0] equal to ‘01’
Select the polarity on ETR pin by setting TIMx_SMCTRL.EXTP equal to ‘0’, The rising edge of ETR is valid
Timer clock = CK_CNT=CK_PSC
TI2
CNTEN
TITF
Counter register
64
65
Write TITF=0
66
Encode mode
External clock
mode 1
External clock
mode 2
Internal clock
mode
TIMx_SMCTRL.EXCE
N
TIMx_SMCTRL.SMSE
L[2:0]
TI1F rising or falling
or
TI2F rising or falling
TRGI rising
ETRF rising
CK_INT rising
Filter Down counter
TIMx_SMCTR.EXTF[3:0]
ETRP
f
DTS
Prescaler
/1,/2,/4,/8
TIMx_SMCTRL.EXTPS[1:0]
Polarity Selection
TIMx_SMCTRL.EXTP
ETR pin