AnsweredAssumed Answered

Clearing the OCxREF signal on an external event

Question asked by van.icecream on Feb 14, 2013
Latest reply on Feb 22, 2013 by van.icecream

As described on STM32F100 manual:
The OCxREF signal for a given channel can be driven Low by applying a High level to the ETRF input (OCxCE enable bit of the corresponding TIMx_CCMRx register set to ‘1’). The OCxREF signal remains Low until the next update event, UEV, occurs.

For example, the OCxREF signal) can be connected to the output of a comparator to be used for current handling.

I am trying to do this, and I am using 3 PWM for BLDC motor control (wich works very well for now but lacks current control). I am using OC1, OC2 and OC3 for PWM generation.
When ETR pin is active (output of a LM258 comparator when over current), ONLY the OC3Ref signal is clear and so I only get PWM channel 3 off on over current while channel 1 and 2 should also be off.
Where is the code configuration for ETR:

  /* configure ETR for current control */

This is an OpenSource motor BLDC controller, project page:

Right now the motor works very well, including the Hall Sensor and Brake (using STM32 hardware for this). The only thing missing is over current control.

Thank you in advance.