cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Hall sensor output interpretation

Posted on August 23, 2016 at 16:25

Hello there,

In STM32F4 I am interfacing with a hall sensor attached to a BLDC motor. I have successfully configured TIM4 as HALL/ XOR inputs timer. The problem is, I am having a bit of a problem with interpreting how to use this mechanism with a BLDC motor. My observations are:

- CNT register works as regular, it increases/ decreases (depending on the config) with the prescaller and period config.

- As soon as I move the motor shaft and the 3 hall outputs change its state, the actual CNT value is copied to the CCR1 register and CNT itself is reset.

If my observations are correct, the CCR1 register gives a somewhat accurate information about motor speed. I kind of expected something else- What I need is the information what is the exact hall output state from 1 to 6). I could get that info simply by pooling the 3 inputs state, or using interrupts. But I thought that the Hall timer mechanism gives some better aid in this.

So should I just check the lines state each time I get an interrupt from CNT = 0? Or am I not getting something here.

I would appreciate all help.
0 REPLIES 0