29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RM0008<br />

Advanced-control timers (TIM1&TIM8)<br />

Figure 79. Output stage of capture/compare channel (channel 1 to 3)<br />

ETR<br />

CNT>CCR1<br />

CNT=CCR1<br />

Output mode<br />

controller<br />

OC1REF<br />

Dead-time<br />

generator<br />

OC1_DT<br />

OC1N_DT<br />

‘0’<br />

‘0’<br />

x0<br />

10<br />

11<br />

11<br />

10<br />

0x<br />

0<br />

1<br />

CC1P<br />

TIM1_CCER<br />

0<br />

1<br />

Output<br />

enable<br />

circuit<br />

Output<br />

enable<br />

circuit<br />

OC1<br />

OC1N<br />

CC1NE CC1E TIM1_CCER<br />

OC1CE OC1M[2:0]<br />

DTG[7:0]<br />

CC1NECC1E<br />

CC1NP<br />

MOEOSSI<br />

OSSRTIM1_BDTR<br />

TIM1_CCMR1<br />

TIM1_BDTR<br />

TIM1_CCER<br />

TIM1_CCER<br />

Figure 80. Output stage of capture/compare channel (channel 4)<br />

ETR<br />

To the master mode<br />

controller<br />

0<br />

1<br />

Output<br />

enable<br />

circuit<br />

OC4<br />

CNT > CCR4<br />

Output mode<br />

CNT = CCR4 controller<br />

OC4 REF<br />

CC4P<br />

TIM1_CCER<br />

CC4E<br />

TIM1_CCER<br />

OC2M[2:0]<br />

TIM1_CCMR2<br />

MOEOSSI TIM1_BDTR<br />

OIS4<br />

TIM1_CR2<br />

The capture/compare block is made of one preload register <strong>and</strong> one shadow register. Write<br />

<strong>and</strong> read always access the preload register.<br />

In capture mode, captures are actually done in the shadow register, which is copied into the<br />

preload register.<br />

In compare mode, the content of the preload register is copied into the shadow register<br />

which is compared to the counter.<br />

13.3.6 Input capture mode<br />

In Input capture mode, the Capture/Compare Registers (TIMx_CCRx) are used to latch the<br />

value of the counter after a transition detected by the corresponding ICx signal. When a<br />

capture occurs, the corresponding CCXIF flag (TIMx_SR register) is set <strong>and</strong> an interrupt or<br />

a DMA request can be sent if they are enabled. If a capture occurs while the CCxIF flag was<br />

already high, then the over-capture flag CCxOF (TIMx_SR register) is set. CCxIF can be<br />

cleared by software by writing it to ‘0’ or by reading the captured data stored in the<br />

TIMx_CCRx register. CCxOF is cleared when you write it to ‘0’.<br />

Doc ID 13902 Rev 9 271/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!