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.

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

RM0008<br />

13.3.13 Clearing the OCxREF signal on an external event<br />

The OCxREF signal for a given channel can be driven Low by applying a High level to the<br />

ETRF input (OCxCE enable bit of the corresponding TIMx_CCMRx register set to ‘1’). The<br />

OCxREF signal remains Low until the next update event, UEV, occurs.<br />

This function can only be used in output compare <strong>and</strong> PWM modes, <strong>and</strong> does not work in<br />

forced mode.<br />

For example, the OCxREF signal) can be connected to the output of a comparator to be<br />

used for current h<strong>and</strong>ling. In this case, the ETR must be configured as follow:<br />

1. The External Trigger Prescaler should be kept off: bits ETPS[1:0] of the TIMx_SMCR<br />

register set to ‘00’.<br />

2. The external clock mode 2 must be disabled: bit ECE of the TIMx_SMCR register set to<br />

‘0’.<br />

3. The External Trigger Polarity (ETP) <strong>and</strong> the External Trigger Filter (ETF) can be<br />

configured according to the user needs.<br />

Figure 89 shows the behavior of the OCxREF signal when the ETRF Input becomes High,<br />

for both values of the enable bit OCxCE. In this example, the timer TIMx is programmed in<br />

PWM mode.<br />

Figure 89.<br />

Clearing TIMx OCxREF<br />

counter (CNT)<br />

(CCRx)<br />

ETRF<br />

OCxREF<br />

(OCxCE=’0’)<br />

OCxREF<br />

(OCxCE=’1’)<br />

OCREF_CLR<br />

becomes high<br />

OCREF_CLR<br />

still high<br />

282/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!