TIM4 0x40000800
24 rejestrów/klastrów w tym peryferium.
control register 1
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | CEN | `rw` | Counter enable Note: External clock, gated mode and encoder mode can work only if the CEN bit has been previously set by software. However trigger mode can set the CEN bit automatically by hardware. CEN is cleared automatically in one-pulse mode, when an update event occurs. |
| 1 | 1 | UDIS | `rw` | Update disable This bit is set and cleared by software to enable/disable UEV event generation. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller Buffered registers are then loaded with their preload values. |
| 2 | 1 | URS | `rw` | Update request source This bit is set and cleared by software to select the UEV event sources. Counter overflow/underflow Setting the UG bit Update generation through the slave mode controller |
| 3 | 1 | OPM | `rw` | One-pulse mode |
| 4 | 1 | DIR | `rw` | Direction Note: This bit is read only when the timer is configured in Center-aligned mode or Encoder mode. |
| 5–6 | 2 | CMS | `rw` | Center-aligned mode selection Note: It is not allowed to switch from edge-aligned mode to center-aligned mode as long as the counter is enabled (CEN=1) |
| 7 | 1 | ARPE | `rw` | Auto-reload preload enable |
| 8–9 | 2 | CKD | `rw` | Clock division This bit-field indicates the division ratio between the timer clock (CK_INT) frequency and sampling clock used by the digital filters (ETR, TIx), |
| 11 | 1 | UIFREMAP | `rw` | UIF status bit remapping |
control register 2
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 3 | 1 | CCDS | `rw` | Capture/compare DMA selection |
| 4–6 | 3 | MMS | `rw` | Master mode selection These bits permit to select the information to be sent in master mode to slave timers for synchronization (TRGO). The combination is as follows: When the Counter Enable signal is controlled by the trigger input, there is a delay on TRGO, except if the master/slave mode is selected (see the MSM bit description in TIMx_SMCR register). Note: The clock of the slave timer or ADC must be enabled prior to receive events from the master timer, and must not be changed on-the-fly while triggers are received from the master timer. |
| 7 | 1 | TI1S | `rw` | TI1 selection |
slave mode control register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–2 | 3 | SMS | `rw` | Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. reinitializes the counter, generates an update of the registers and starts the counter. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=00100). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer. |
| 3 | 1 | OCCS | `rw` | OCREF clear selection This bit is used to select the OCREF clear source |
| 4–6 | 3 | TS | `rw` | Trigger selection This bit-field selects the trigger input to be used to synchronize the counter. Others: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition. |
| 7 | 1 | MSM | `rw` | Master/Slave mode |
| 8–11 | 4 | ETF | `rw` | External trigger filter This bit-field then defines the frequency used to sample ETRP signal and the length of the digital filter applied to ETRP. The digital filter is made of an event counter in which N consecutive events are needed to validate a transition on the output: |
| 12–13 | 2 | ETPS | `rw` | External trigger prescaler External trigger signal ETRP frequency must be at most 1/4 of CK_INT frequency. A prescaler can be enabled to reduce ETRP frequency. It is useful when inputting fast external clocks. |
| 14 | 1 | ECE | `rw` | External clock enable This bit enables External clock mode 2. Note: Setting the ECE bit has the same effect as selecting external clock mode 1 with TRGI connected to ETRF (SMS=111 and TS=00111). It is possible to simultaneously use external clock mode 2 with the following slave modes: reset mode, gated mode and trigger mode. Nevertheless, TRGI must not be connected to ETRF in this case (TS bits must not be 00111). If external clock mode 1 and external clock mode 2 are enabled at the same time, the external clock input is ETRF. |
| 15 | 1 | ETP | `rw` | External trigger polarity This bit selects whether ETR or ETR is used for trigger operations |
| 16 | 1 | SMS_3 | `rw` | Slave mode selection When external signals are selected the active edge of the trigger signal (TRGI) is linked to the polarity selected on the external input (see Input Control register and Control Register description. reinitializes the counter, generates an update of the registers and starts the counter. Note: The gated mode must not be used if TI1F_ED is selected as the trigger input (TS=00100). Indeed, TI1F_ED outputs 1 pulse for each transition on TI1F, whereas the gated mode checks the level of the trigger signal. Note: The clock of the slave peripherals (timer, ADC, ...) receiving the TRGO or the TRGO2 signals must be enabled prior to receive events from the master timer, and the clock frequency (prescaler) must not be changed on-the-fly while triggers are received from the master timer. |
| 20–21 | 2 | TS2 | `rw` | Trigger selection This bit-field selects the trigger input to be used to synchronize the counter. Others: Reserved See for more details on ITRx meaning for each Timer. Note: These bits must be changed only when they are not used (e.g. when SMS=000) to avoid wrong edge detections at the transition. |
DMA/Interrupt enable register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | UIE | `rw` | Update interrupt enable |
| 1 | 1 | CC1IE | `rw` | Capture/Compare 1 interrupt enable |
| 2 | 1 | CC2IE | `rw` | Capture/Compare 2 interrupt enable |
| 3 | 1 | CC3IE | `rw` | Capture/Compare 3 interrupt enable |
| 4 | 1 | CC4IE | `rw` | Capture/Compare 4 interrupt enable |
| 6 | 1 | TIE | `rw` | Trigger interrupt enable |
| 8 | 1 | UDE | `rw` | Update DMA request enable |
| 9 | 1 | CC1DE | `rw` | Capture/Compare 1 DMA request enable |
| 10 | 1 | CC2DE | `rw` | Capture/Compare 2 DMA request enable |
| 11 | 1 | CC3DE | `rw` | Capture/Compare 3 DMA request enable |
| 12 | 1 | CC4DE | `rw` | Capture/Compare 4 DMA request enable |
| 14 | 1 | TDE | `rw` | Trigger DMA request enable |
status register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | UIF | `rw` | Update interrupt flag This bit is set by hardware on an update event. It is cleared by software. At overflow or underflow and if UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by software using the UG bit in TIMx_EGR register, if URS=0 and UDIS=0 in the TIMx_CR1 register. When CNT is reinitialized by a trigger event (refer to the synchro control register description), if URS=0 and UDIS=0 in the TIMx_CR1 register. |
| 1 | 1 | CC1IF | `rw` | Capture/compare 1 interrupt flag |
| 2 | 1 | CC2IF | `rw` | Capture/compare 2 interrupt flag |
| 3 | 1 | CC3IF | `rw` | Capture/compare 3 interrupt flag |
| 4 | 1 | CC4IF | `rw` | Capture/compare 4 interrupt flag |
| 6 | 1 | TIF | `rw` | Trigger interrupt flag This flag is set by hardware on the TRG trigger event (active edge detected on TRGI input when the slave mode controller is enabled in all modes but gated mode. It is set when the counter starts or stops when gated mode is selected. It is cleared by software. |
| 9 | 1 | CC1OF | `rw` | Capture/Compare 1 overcapture flag |
| 10 | 1 | CC2OF | `rw` | Capture/Compare 2 overcapture flag |
| 11 | 1 | CC3OF | `rw` | Capture/Compare 3 overcapture flag |
| 12 | 1 | CC4OF | `rw` | Capture/Compare 4 overcapture flag |
event generation register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | UG | `wo` | Update generation This bit can be set by software, it is automatically cleared by hardware. |
| 1 | 1 | CC1G | `wo` | Capture/compare 1 generation |
| 2 | 1 | CC2G | `wo` | Capture/compare 2 generation |
| 3 | 1 | CC3G | `wo` | Capture/compare 3 generation |
| 4 | 1 | CC4G | `wo` | Capture/compare 4 generation |
| 6 | 1 | TG | `wo` | Trigger generation This bit is set by software in order to generate an event, it is automatically cleared by hardware. |
capture/compare mode register 1 (input mode)
Brak zdefiniowanych pól bitowych.
capture/compare mode register 1 (output mode)
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–1 | 2 | CC1S | `rw` | Capture/Compare 1 selection |
| 0–1 | 2 | CC1S: | — | Capture/Compare 1 selection |
| 2 | 1 | OC1FE: | — | Output compare 1 fast enable |
| 2–3 | 2 | IC1PSC: | — | Input capture 1 prescaler |
| 3 | 1 | OC1PE | `rw` | Output compare 1 preload enable |
| 4–6 | 3 | OC1M | `rw` | Output compare 1 mode |
| 4–7 | 4 | IC1F: | — | Input capture 1 filter |
| 7 | 1 | OC1CE | `rw` | Output compare 1 clear enable |
| 8–9 | 2 | CC2S | `rw` | Capture/Compare 2 selection |
| 8–9 | 2 | CC2S: | — | Capture/compare 2 selection |
| 10 | 1 | OC2FE: | — | Output compare 2 fast enable |
| 10–11 | 2 | IC2PSC: | — | Input capture 2 prescaler |
| 11 | 1 | OC2PE | `rw` | Output compare 2 preload enable |
| 12–14 | 3 | OC2M | `rw` | Output compare 2 mode |
| 12–15 | 4 | IC2F: | — | Input capture 2 filter |
| 15 | 1 | OC2CE | `rw` | Output compare 2 clear enable |
| 16 | 1 | OC1M_3: | — | Output compare 1 mode, bit 3 |
| 24 | 1 | OC2M_3: | — | Output compare 2 mode, bit 3 |
capture/compare mode register 2 (input mode)
Brak zdefiniowanych pól bitowych.
capture/compare mode register 2 (output mode)
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–1 | 2 | CC3S | — | Capture/Compare 3 selection |
| 0–1 | 2 | CC3S | `rw` | Capture/Compare 3 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC3S bits are writable only when the channel is OFF (CC3E = 0 in TIMx_CCER). |
| 2 | 1 | OC3FE | — | Output compare 3 fast enable |
| 2–3 | 2 | IC3PSC | — | Input capture 3 prescaler |
| 3 | 1 | OC3PE | — | Output compare 3 preload enable |
| 4–6 | 3 | OC3M | — | Output compare 3 mode |
| 4–7 | 4 | IC3F | — | Input capture 3 filter |
| 7 | 1 | OC3CE | — | Output compare 3 clear enable |
| 8–9 | 2 | CC4S | — | Capture/Compare 4 selection |
| 8–9 | 2 | CC4S | `rw` | Capture/Compare 4 selection This bit-field defines the direction of the channel (input/output) as well as the used input. Note: CC4S bits are writable only when the channel is OFF (CC4E = 0 in TIMx_CCER). |
| 10 | 1 | OC4FE | — | Output compare 4 fast enable |
| 10–11 | 2 | IC4PSC | — | Input capture 4 prescaler |
| 11 | 1 | OC4PE | — | Output compare 4 preload enable |
| 12–14 | 3 | OC4M | — | Output compare 4 mode |
| 12–15 | 4 | IC4F | — | Input capture 4 filter |
| 15 | 1 | OC4CE | — | Output compare 4 clear enable |
| 16 | 1 | OC3M_3 | — | Output compare 3 mode, bit 3 |
| 24 | 1 | OC4M_3 | — | Output compare 4 mode, bit 3 |
capture/compare enable register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | CC1E | `rw` | Capture/Compare 1 output enable |
| 1 | 1 | CC1P | `rw` | Capture/Compare 1 output Polarity |
| 3 | 1 | CC1NP | `rw` | Capture/Compare 1 output Polarity |
| 4 | 1 | CC2E | `rw` | Capture/Compare 2 output enable |
| 5 | 1 | CC2P | `rw` | Capture/Compare 2 output Polarity |
| 7 | 1 | CC2NP | `rw` | Capture/Compare 2 output Polarity |
| 8 | 1 | CC3E | `rw` | Capture/Compare 3 output enable |
| 9 | 1 | CC3P | `rw` | Capture/Compare 3 output Polarity |
| 11 | 1 | CC3NP | `rw` | Capture/Compare 3 output Polarity |
| 12 | 1 | CC4E | `rw` | Capture/Compare 4 output enable |
| 13 | 1 | CC4P | `rw` | Capture/Compare 4 output Polarity |
| 15 | 1 | CC4NP | `rw` | Capture/Compare 4 output Polarity |
counter
Brak zdefiniowanych pól bitowych.
16-bit counter register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | CNT | `rw` | Counter value |
| 0–15 | 16 | CNT | `rw` | counter value |
| 31 | 1 | UIFCPY | `rw` | UIF Copy This bit is a read-only copy of the UIF bit of the TIMx_ISR register |
prescaler
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | PSC: | — | Prescaler value |
auto-reload register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | ARR | `rw` | High auto-reload value (TIM2) nullLow Auto-reload value ARR is the value to be loaded in the actual auto-reload register. Refer to the for more details about ARR update and behavior. The counter is blocked while the auto-reload value is null. |
capture/compare register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | CCR | `rw` | Capture/Compare value |
capture/compare register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | CCR | `rw` | Capture/Compare value |
capture/compare register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | CCR | `rw` | Capture/Compare value |
capture/compare register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | CCR | `rw` | Capture/Compare value |
DMA control register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–4 | 5 | DBA | `rw` | DMA base address This 5-bit vector defines the base-address for DMA transfers (when read/write access are done through the TIMx_DMAR address). DBA is defined as an offset starting from the address of the TIMx_CR1 register. Example: ... Example: Let us consider the following transfer: DBL = 7 transfers & DBA = TIMx_CR1. In this case the transfer is done to/from 7 registers starting from the TIMx_CR1 address. |
| 8–12 | 5 | DBL | `rw` | DMA burst length This 5-bit vector defines the number of DMA transfers (the timer recognizes a burst transfer when a read or a write access is done to the TIMx_DMAR address). ... |
DMA address for full transfer
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | DMAB: | — | DMA register for burst accesses |
TIM option register
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | OCREF_CLR | `rw` | Ocref_clr source selection This bit selects the ocref_clr input source. |
TIM alternate function option register 1
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 14–17 | 4 | ETRSEL | `rw` | ETR source selection These bits select the ETR input source. Others: Reserved |
TIM alternate function option register 1
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–3 | 4 | TI1SEL | `rw` | TI1[0] to TI1[15] input selection These bits select the TI1[0] to TI1[15] input source. Others: Reserved |
| 8–11 | 4 | TI2SEL | `rw` | TI2[0] to TI2[15] input selection These bits select the TI2[0] to TI2[15] input source. Others: Reserved |