
Nations Technologies Inc.
Tel:+86-755-86309900
Email:info@nationstech.com
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
V
Advanced-control timers (TIM1 and TIM8)
...............................................................................................................158
TIM1 and TIM8 introduction
.................................................................................................................................. 158
Main features of TIM1 and TIM8
............................................................................................................................ 158
TIM1 and TIM8 function description
...................................................................................................................... 159
Time-base unit
................................................................................................................................................. 159
Counter mode
.................................................................................................................................................. 160
Repetition counter
........................................................................................................................................... 167
Clock selection
................................................................................................................................................ 170
Capture/compare channels
............................................................................................................................... 173
Input capture mode
.......................................................................................................................................... 176
PWM input mode
............................................................................................................................................ 177
Forced output mode
......................................................................................................................................... 178
Output compare mode
......................................................................................................................................179
PWM mode
................................................................................................................................................... 180
One-pulse mode
............................................................................................................................................. 183
Clearing the OCxREF signal on an external event
........................................................................................... 184
Complementary outputs with dead-time insertion
........................................................................................... 185
Break function
............................................................................................................................................... 187
Debug mode
.................................................................................................................................................. 189
TIMx and external trigger synchronization
..................................................................................................... 189
Timer synchronization
.................................................................................................................................... 193
6-step PWM generation
.................................................................................................................................. 193
Encoder interface mode
.................................................................................................................................. 194
Interfacing with Hall sensor
........................................................................................................................... 196
TIMx registers(x=1, 8)
............................................................................................................................................ 198
TIMx register overview
.................................................................................................................................... 198
Control register 1 (TIMx_CTRL1)
................................................................................................................... 199
Control register 2 (TIMx_CTRL2)
................................................................................................................... 201
Slave mode control register (TIMx_SMCTRL)
................................................................................................. 203
DMA/Interrupt enable registers (TIMx_DINTEN)
............................................................................................ 206
Status registers (TIMx_STS)
............................................................................................................................ 207
Event generation registers (TIMx_EVTGEN)
...................................................................................................209
Capture/compare mode register 1 (TIMx_CCMOD1)
....................................................................................... 210
Capture/compare mode register 2 (TIMx_CCMOD2)
....................................................................................... 213
Capture/compare enable registers (TIMx_CCEN)
........................................................................................... 215
Counters (TIMx_CNT)
.................................................................................................................................. 218
Prescaler (TIMx_PSC)
................................................................................................................................... 218
Auto-reload register (TIMx_AR)
.................................................................................................................... 218
Repeat count registers (TIMx_REPCNT)
....................................................................................................... 219
Capture/compare register 1 (TIMx_CCDAT1)
................................................................................................ 219
Capture/compare register 2 (TIMx_CCDAT2)
................................................................................................ 220
Capture/compare register 3 (TIMx_CCDAT3)
................................................................................................ 220
Capture/compare register 4 (TIMx_CCDAT4)
................................................................................................ 221
Break and Dead-time registers (TIMx_BKDT)
............................................................................................... 221
DMA Control register (TIMx_DCTRL)
.......................................................................................................... 223
DMA transfer buffer register (TIMx_DADDR)
.............................................................................................. 224
Capture/compare mode registers 3(TIMx_CCMOD3)
..................................................................................... 225
Capture/compare register 5 (TIMx_CCDAT5)
................................................................................................ 225
Capture/compare register 6 (TIMx_CCDAT6)
................................................................................................ 226
General-purpose timers (TIM2, TIM3, TIM4, TIM5 and TIM9)
...............................................................................227
General-purpose timers introduction
........................................................................................................................ 227
Main features of General-purpose timers
................................................................................................................. 227
General-purpose timers description
......................................................................................................................... 228
Time-base unit
................................................................................................................................................. 228
Counter mode
.................................................................................................................................................. 229
Clock selection
................................................................................................................................................ 235