MCBSTM32EXL Keil, MCBSTM32EXL Datasheet - Page 332

no-image

MCBSTM32EXL

Manufacturer Part Number
MCBSTM32EXL
Description
BOARD EVALUATION FOR STM32F103ZE
Manufacturer
Keil
Datasheets

Specifications of MCBSTM32EXL

Lead Free Status / RoHS Status
Lead free / RoHS Compliant
General-purpose timer (TIMx)
Note:
332/995
Figure 119. Control circuit in normal mode, internal clock divided by 1
External clock source mode 1
This mode is selected when SMS=111 in the TIMx_SMCR register. The counter can count
at each rising or falling edge on a selected input.
Figure 120. TI2 external clock connection example
For example, to configure the upcounter to count in response to a rising edge on the TI2
input, use the following procedure:
For example, to configure the upcounter to count in response to a rising edge on the TI2
input, use the following procedure:
1.
2.
The capture prescaler is not used for triggering, so you don’t need to configure it.
3.
4.
5.
6.
When a rising edge occurs on TI2, the counter counts once and the TIF flag is set.
Configure channel 2 to detect rising edges on the TI2 input by writing CC2S= ‘01’ in the
TIMx_CCMR1 register.
Configure the input filter duration by writing the IC2F[3:0] bits in the TIMx_CCMR1
register (if no filter is needed, keep IC2F=0000).
Select rising edge polarity by writing CC2P=0 in the TIMx_CCER register.
Configure the timer in external clock mode 1 by writing SMS=111 in the TIMx_SMCR
register.
Select TI2 as the input source by writing TS=110 in the TIMx_SMCR register.
Enable the counter by writing CEN=1 in the TIMx_CR1 register.
Counter clock = CK_CNT = CK_PSC
TI2
TIMx_CCMR1
ICF[3:0]
Filter
COUNTER REGISTER
Detector
CEN=CNT_EN
Edge
CNT_INIT
CK_INT
TI2F_Falling
TI2F_Rising
UG
Doc ID 13902 Rev 9
TIMx_CCER
CC2P
0
1
31
32 33 34 35 36
ITRx
TI1F_ED
TI1FP1
TI2FP2
ETRF
TIMx_SMCR
TS[2:0]
001
100
101
110
111
CK_INT
or
TRGI
ETRF
(internal clock)
TI1F
TI2F
00
01 02 03 04 05 06 07
or
or
ECE
encoder
mode
external clock
mode 1
external clock
mode 2
internal clock
mode
TIMx_SMCR
SMS[2:0]
CK_PSC
RM0008

Related parts for MCBSTM32EXL