This is an old revision of the document!


Timer 2..5

The STM32F429ZI offers several general purpouse timers. Timer 2 and 5 are 32 bit timers, while timer 3 and 4 are 16 bit timers. They may be used for measuring time (basic timer), measuring input pulse length (input capturing) or generating waveforms (output compare / PWM). The timers are fully independent and can be synchronized together.

  • 16-bit / 32-bit up, down, up/down auto-reload counter.
  • Prescaler (16 bit) to adjust counting clock, even during runtime.
  • 4 independent channels for:
    • Input capture
    • Output compare
    • PWM generation (edge- and center-aligned)
    • One-pulse output
  • Synchronization / control through external signals.
  • Interrupt / DMA generation.




Configuration Registers
CR1Control Register 1
PSCPrescaler register
ARRAuto reload register
DIERDMA / Interrupt enable register
Data Registers
CNTCounting register

Upcounting

Downcounting

Up/Down counting







CR1




DIR0Counter used as upcounter
1Counter used as downcounter
This bit is readonly in center-aligned or encoder mode
OPM0Counter is not stopped at update event
1Counter stops at the next update event
CEN0Counter disabled
1Counter enabled

CR2




MMS000Reset
001Enable
010Update
011Compare Pulse
100Compare OC1REF signal is used as TRGO
101Compare OC2REF signal is used as TRGO
110Compare OC3REF signal is used as TRGO
111Compare OC4REF signal is used as TRGO
CCDS0CCx DMA request sent when CCx event occurs
1CCx DMA request sent when update event occurs

PSC




ARR




DIER




TDE0Trigger DMA request disabled
1Trigger DMA request enabled
CCxDE0CCx DMA request disabled
1CCx DMA request enabled
UDE0Update DMA request disabled
1Update DMA request enabled
TIE0Trigger interrupt disabled
1Trigger interrupt enabled
CCxIE0CCx interrupt disabled
1CCx interrupt enabled
UIE0Update interrupt disabled
1Update interrupt enabled

CCMR1/2

CCxS00CCx channel is configured as output
01CCx channel is configured as input, ICx is mapped directly
10CCx channel is configured as input, ICx is mapped crossed
11CCx channel is configured as input, ICx is mapped on TRC
CCxS bits are only writeable when the channel is off (CCxE = 0, CCER)
Input Configuration




Output Configuration




OCxM000Frozen Compairson of CNT and CCRx has no effect on OCxREF
001Active OCxREF high if CNT equals CCRx
010Inactive OCxREF low if CNT equals CCRx
011Toggle OCxREF toggles if CNT equals CCRx
100Force Inactive OCxREF forced low
101Forced Active OCxREF forced high
110PWM 1 OCxREF high if CNT < CCRx
111PWM 2 OCxREF low if CNT > CCRx

SMCR - Slave Mode Control Register




ETP - External Trigger Polarity
0ETR is not inverted, active at high level or rising edge
1ETR is inverted, active at low level or falling edge
ECE - External Clock Enable
0External clock mode 2 disabled
1External clock mode 2 enabled. Clock enabled by any active edge on ETRF

CCER




EGR




SR




CNT




CCRx







  • stm32/peripherals/timer.1467026049.txt.gz
  • Last modified: 2016/06/27 11:14
  • by feur