29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

General-purpose timer (TIMx)<br />

Figure 125. Capture/compare channel 1 main circuit<br />

APB Bus<br />

MCU-peripheral interface<br />

read CCR1H S<br />

read CCR1L<br />

R<br />

CC1S[1]<br />

CC1S[0]<br />

IC1PS<br />

CC1E<br />

CC1G<br />

TIMx_EGR<br />

read_in_progress<br />

input<br />

mode<br />

Capture/Compare Preload Register<br />

capture_transfer<br />

Capture/Compare Shadow Register<br />

capture<br />

8 8<br />

high<br />

(if 16-bit)<br />

Counter<br />

low<br />

compare_transfer<br />

write_in_progress<br />

comparator<br />

output<br />

mode<br />

CNT>CCR1<br />

CNT=CCR1<br />

S<br />

R<br />

write CCR1H<br />

write CCR1L<br />

CC1S[1]<br />

CC1S[0]<br />

OC1PE<br />

OC1PE<br />

UEV<br />

TIMx_CCMR1<br />

(from time<br />

base unit)<br />

Figure 126. Output stage of capture/compare channel (channel 1)<br />

ETRF<br />

To the master mode<br />

controller<br />

0<br />

1<br />

Output<br />

Enable<br />

Circuit<br />

OC1<br />

CNT > CCR1<br />

Output Mode<br />

CNT = CCR1 Controller<br />

oc1ref<br />

CC1P<br />

TIMx_CCER<br />

CC1E<br />

TIMx_CCER<br />

OC1M[2:0]<br />

TIMx_CCMR1<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 />

Doc ID 13902 Rev 9 335/995

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

Saved successfully!

Ooh no, something went wrong!