Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
162
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

RM0016

16-bit general purpose timers (TIM2, TIM3, TIM5)

 

 

Output stage

Refer to Section 17.5.4: Output stage on page 168, Section 17.5.5: Forced output mode on page 169, Section 17.5.7: PWM mode on page 171.

Note:

As the clock/trigger controller and the associated TIMx_CR2 and TIMx_SMCR registers are

 

not implemented in TIM2/TIM3, the one-pulse mode (described in Section 17.5.7: PWM

 

mode) is not available in TIM2/TIM3.

 

 

 

 

 

As shown in Figure 87. TIMx outputs have no deadtime or complementary outputs.

 

Figure 87. Output stage

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OC1REF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

output

 

TIMx_CH1

 

 

 

 

 

 

 

 

 

 

 

control

 

 

from capture/compare

 

 

OC2REF

OC1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

output

 

TIMx_CH2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

control

 

 

channels

 

 

OC3REF

 

OC2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

output

 

 

TIMx_CH3

 

 

 

 

 

 

 

 

 

 

 

control

 

 

 

 

 

 

 

OC3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The output stage generates an intermediate waveform which is then used for reference: OCxREF (active high). Polarity acts at the end of the chain (see Figure 88).

Figure 88. Output stage of channel 1

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

Counter > CCR1

 

 

 

 

 

 

 

 

 

Output

 

OC1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Output Mode

 

OC1REF

 

 

 

 

 

 

 

 

 

Enable

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

 

Circuit

 

 

 

Counter = CCR1

 

 

 

 

 

Controller

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CC1P

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIMx_CCER1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OC1M[2:0]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIMx_CCMR1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CC1E

TIMx_CCER1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

18.5TIM2/TIM3/TIM5 interrupts

The timers have 4 interrupt request sources:

Capture/compare 3 interrupt

Capture/compare 2 interrupt

Capture/compare 1 interrupt

Update interrupt

Trigger interrupt (TIM5 only)

To use the interrupt features, for each interrupt channel used, set the desired CC3IE and/or CC2IE and/or CC1IE bits in the TIMx_IER register to enable interrupt requests.

Doc ID 14587 Rev 9

221/454

16-bit general purpose timers (TIM2, TIM3, TIM5)

RM0016

 

 

The different interrupt sources can be also generated by software using the corresponding bits in the TIMx_EGR register.

222/454

Doc ID 14587 Rev 9

Соседние файлы в папке Минимум документации STM8_1