Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
stm32:peripherals:timer [2016/06/27 11:14] – created feur | stm32:peripherals:timer [2023/02/08 12:57] (current) – [Functions] frtt | ||
---|---|---|---|
Line 3: | Line 3: | ||
{{ timer_complete.svg? | {{ timer_complete.svg? | ||
- | The STM32F429ZI offers several general | + | The STM32F429ZI offers several general |
===== Features ===== | ===== Features ===== | ||
Line 16: | Line 16: | ||
* Synchronization / control through external signals. | * Synchronization / control through external signals. | ||
* Interrupt / DMA generation. | * Interrupt / DMA generation. | ||
+ | \\ | ||
===== Functions ===== | ===== Functions ===== | ||
- | ==== Base Timer ==== | + | These functions are available: |
- | + | * The [[timer_base|basic timer]] function governs the core timer itself, eg. counting mode, reload-values, etc. | |
- | \\ {{timer_base.svg}} \\ \\ | + | * The [[timer_clock|clock source]] controls |
- | + | * The [[timer_compare|compare]] function is used for generating | |
- | == Configuration Registers == | + | * The capture function |
- | + | ||
- | |< 100% 10em >| | + | |
- | |[[#registers|CR1]]|Control Register 1| | + | |
- | |[[# | + | |
- | |[[# | + | |
- | |[[#registers|DIER]]|DMA / Interrupt enable register| | + | |
- | + | ||
- | == Data Registers == | + | |
- | + | ||
- | |< 100% 10em >| | + | |
- | |[[# | + | |
- | + | ||
- | === Upcounting === | + | |
- | + | ||
- | === Downcounting === | + | |
- | + | ||
- | === Up/Down counting === | + | |
- | + | ||
- | ==== Clock Source ==== | + | |
- | + | ||
- | \\ {{timer_clock.svg}} \\ \\ | + | |
- | + | ||
- | ==== Output Compare ==== | + | |
- | + | ||
- | \\ {{timer_output.svg}} \\ \\ | + | |
- | + | ||
- | ===== Registers ===== | + | |
- | + | ||
- | ==== Configuration Registers ==== | + | |
- | + | ||
- | === CR1 === | + | |
- | + | ||
- | \\ {{timer_reg_cr1.svg}} \\ \\ | + | |
- | + | ||
- | |< 100% 5em 5em >| | + | |
- | |DIR|0|Counter used as upcounter| | + | |
- | |::: | + | |
- | |:::|//This bit is readonly in center-aligned or encoder mode//|| | + | |
- | |OPM|0|Counter is **not** stopped at update event| | + | |
- | |::: | + | |
- | |CEN|0|Counter disabled| | + | |
- | |::: | + | |
- | + | ||
- | === CR2 === | + | |
- | + | ||
- | \\ {{timer_reg_cr2.svg}} \\ \\ | + | |
- | + | ||
- | |< 100% 5em 5em >| | + | |
- | |MMS|000|**Reset**| | + | |
- | |::: | + | |
- | |::: | + | |
- | |::: | + | |
- | |::: | + | |
- | |::: | + | |
- | |::: | + | |
- | |::: | + | |
- | |CCDS|0|CCx DMA request sent when CCx event occurs| | + | |
- | |::: |1|CCx DMA request sent when update event occurs| | + | |
- | + | ||
- | === PSC === | + | |
- | + | ||
- | \\ {{timer_reg_psc.svg}} \\ \\ | + | |
- | + | ||
- | === ARR === | + | |
- | + | ||
- | \\ {{timer_reg_arr.svg}} \\ \\ | + | |
- | + | ||
- | === DIER === | + | |
- | + | ||
- | \\ {{timer_reg_dier.svg}} \\ \\ | + | |
- | + | ||
- | |< 100% 5em 5em >| | + | |
- | |TDE|0|Trigger DMA request disabled| | + | |
- | |::: | + | |
- | |CCxDE|0|CCx DMA request disabled| | + | |
- | |::: |1|CCx DMA request enabled| | + | |
- | |UDE|0|Update DMA request disabled| | + | |
- | |::: | + | |
- | |TIE|0|Trigger interrupt disabled| | + | |
- | |::: | + | |
- | |CCxIE|0|CCx interrupt disabled| | + | |
- | |::: |1|CCx interrupt enabled| | + | |
- | |UIE|0|Update interrupt disabled| | + | |
- | |::: | + | |
- | + | ||
- | === CCMR1/2 === | + | |
- | + | ||
- | |< 100% 5em 5em >| | + | |
- | |CCxS|00|CCx channel is configured as output| | + | |
- | |::: |01|CCx channel is configured as input, ICx is mapped directly| | + | |
- | |::: |10|CCx channel is configured as input, ICx is mapped crossed| | + | |
- | |::: |11|CCx 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 == | + | |
- | + | ||
- | \\ {{timer_reg_ccmr2.svg}} {{timer_reg_ccmr1.svg}} \\ \\ | + | |
- | + | ||
- | == Output Configuration == | + | |
- | + | ||
- | \\ {{timer_reg_ccmr2.svg}} {{timer_reg_ccmr1.svg}} \\ \\ | + | |
- | + | ||
- | |< 100% 5em 5em >| | + | |
- | |OCxM|000|**Frozen** Compairson of CNT and CCRx has no effect on OCxREF| | + | |
- | |::: |001|**Active** OCxREF high if CNT equals CCRx| | + | |
- | |::: |010|**Inactive** OCxREF low if CNT equals CCRx| | + | |
- | |::: |011|**Toggle** OCxREF toggles if CNT equals CCRx| | + | |
- | |::: |100|**Force Inactive** OCxREF forced low| | + | |
- | |::: |101|**Forced Active** OCxREF forced high| | + | |
- | |::: |110|**PWM 1** OCxREF high if CNT < CCRx| | + | |
- | |::: |111|**PWM 2** OCxREF low if CNT > CCRx| | + | |
- | + | ||
- | === SMCR - Slave Mode Control Register === | + | |
- | + | ||
- | \\ {{timer_reg_smcr.svg}} \\ \\ | + | |
- | + | ||
- | == ETP - External Trigger Polarity == | + | |
- | |< 100% 5em >| | + | |
- | |0|ETR is **not** inverted, active at high level or rising edge| | + | |
- | |1|ETR | + | |
- | + | ||
- | == ECE - External Clock Enable == | + | |
- | |< 100% 5em >| | + | |
- | |0|External clock mode 2 disabled| | + | |
- | |1|External clock mode 2 enabled. Clock enabled by any active edge on ETRF| | + | |
- | + | ||
- | + | ||
- | === CCER === | + | |
- | + | ||
- | \\ {{timer_reg_ccer.svg}} \\ \\ | + | |
- | + | ||
- | === EGR === | + | |
- | + | ||
- | \\ {{timer_reg_egr.svg}} \\ \\ | + | |
- | + | ||
- | === SR === | + | |
- | + | ||
- | \\ {{timer_reg_sr.svg}} \\ \\ | + | |
- | + | ||
- | ==== Data Registers ==== | + | |
- | + | ||
- | === CNT === | + | |
- | + | ||
- | \\ {{timer_reg_cnt.svg}} \\ \\ | + | |
- | + | ||
- | === CCRx === | + | |
- | + | ||
- | \\ {{timer_reg_ccrx.svg}} \\ \\ | + | |
- | + | ||
- | ===== Legend ===== | + | |
- | + | ||
- | \\ {{legende.svg}} \\ \\ | + |