09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

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

14.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 and PWM modes, and does not work in<br />

forced mode.<br />

For example, the ETR signal can be connected to the output of a comparator to be used for<br />

current handling. 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) and the External Trigger Filter (ETF) can be<br />

configured according to the user needs.<br />

Figure 109 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 109. Clearing TIMx OCxREF<br />

counter (CNT)<br />

ETRF<br />

OCxREF<br />

(OCxCE=’0’)<br />

OCxREF<br />

(OCxCE=’1’)<br />

(CCRx)<br />

ETRF<br />

becomes high<br />

ETRF<br />

still high<br />

Note: In case of a PWM with a 100% duty cycle (if CCRx>ARR), then OCxREF is enabled again at<br />

the next counter overflow.<br />

Doc ID 018909 Rev 3 378/1416

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

Saved successfully!

Ooh no, something went wrong!