267
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
Figure 11-1 Block diagram of TIM1 and TIM8
The event
Interrupt and DMA output
The capture channel 1 input can come from IOM or comparator output
TIM1 and TIM8 function description
11.3.1
Time-base unit
The advanced-control’s time-base unit mainly includes: prescaler, counter, auto-reload and repetition counter. When
the time base unit is working, the software can read and write the corresponding registers (TIMx_PSC, TIMx_CNT,
TIMx_AR and TIMx_REPCNT) at any time.
Depending on the setting of the auto-reload preload enable bit (TIMx_CTRL1.ARPEN), the value of the preload
register is transferred to the shadow register immediately or at each update event UEV. An update event is generated
when the counter reaches the overflow/underflow condition and it can be generated by software when
TIMx_CTRL1.UPDIS=0. The counter CK_CNT is valid only when the TIMx_CTRL1.CNTEN bit is set. The counter
starts counting one clock cycle after the TIMx_CTRL1.CNTEN bit is set.
TI2FP1
TI2FP2
TI1FP2
TI3FP3
TI1FP1
TI4FP4
XOR
TI2
TI3
TI1
TI4
Polarity
selection
BRK
IC4
IC1
IC2
IC3
Clock failure event From clock controller CSS(Clock Security System)
PVD abnormal (Power supply voltage detection)
LOOKUP(Core Hardfault)
Comparator polarity
TRC
TRC
TRC
TRC
TI4FP3
CCxIT
(
Input
)
CCx Event
(
Input
)
ETRF
TIMx_CH2
TIMx_CH3
TIMx_CH4
Input filter &
edge detector
ICxPS
Prescaler
OCxREF
CCxIT
(
Output
)
Output Control
(DTG,
Complementary)
Capture/Compare x
(x = 1
,
2
,
3
,
4)
register
Capture/Compare x
(x = 5,6) register
TIMx_CH1
OC1
OC1N
TIMx_CH1N
TIMx_CH2
OC2
OC2N
TIMx_CH2N
TIMx_CH3
OC3
OC3N
TIMx_CH3N
OC4
TIMx_CH4
OCxREF
CNT Counter
Output Control
OC6
OC5
TIMx_BKIN
Input filter &
edge detector
TI3FP4
Input filter &
edge detector
Input filter &
edge detector
E
T
R
F
TIT
Trigger controller
TRGI
TRGO
TI1F_ED
Psc Prescaler
CK_CNT
CK_PSC
Auto-reload
Update
event
Reptition counter
ETRF
Polarity selection
Edge detector
Prescaler
Input filter
TIMx_ETR pin
COMP_TIM_
OCREFCLR
TRC
Slave mode
controller
Encoder mode
To another timer, ADC,
DAC
Internal clock(CK_INT)
CK_TIM18 from RCC
ETR
TI
1
F
_
ED
BIT
Reset, enable,
up/down, count
UDIT
TIMx_CH1