2020-08-13 01:03 PM
Hello everyone,
I'm trying to build a sensorless 6 step BDLC motor control. I'm using 3 external interrupts to detect rising and falling BEMF signals and 6 step commutation sequence and the motor works fine for different PWM values. Now I'm trying to add a potentiometer and use DMA IRQ handlerto control the PWM value and speed of the motor. Can anyone let me know if I can use DMA IRQ handler along with external interrupt handler. I have tried giving preemt priority 0 for exxternal interrupts and 1 for DMA IRQ. But it doesnt work as expected
2020-08-13 02:54 PM
What STM32 specifically, there are hundreds of different ones
I would avoid doing anything blocking or (other) interrupt related programming within callback/interrupt context, almost certainly going to cause a headache. Watch specifically delays and timeouts. The callback/interrupts should leave promptly, don't be waiting/dwelling for things to happen.
Have you set the NVIC grouping to allow for preemption? It won't reenter at the current level.
2020-08-13 11:07 PM
Hi clive,
I'm using STM32F103C8.
I'm using void EXTI3_IRQHandler(void), void EXTI1_IRQHandler(void), void EXTI2_IRQHandler(void) 3 IRQ handlers to identify A, B , C BEMF signals as interrupts and perform commutation sequence.
For the above 3 preemption is given highest priority. HAL_NVIC_SetPriority(EXTI1_IRQn, 0, 0). The motor works fine
Now I want to add ADC and enabled ADC global interrupt. I want to read the potentiometer value from ADC and map the same to Duty of the PWM.
2020-10-06 12:08 AM
Dear @KKuma.4
Thanks for your answers to @Community member questions.
I hope it will help him to help you.
Best regards
Laurent Ca...
2020-10-20 08:23 AM
Dear @KKuma.4 , dear @Community member
Any news?
Best regards
Laurent Ca...
2020-10-22 12:53 AM
@KKuma.4
Hello,
FYI, we provide 6-step example using potentiometer through the STSPIN32xx board usage. Did you inspire from these examples ?
Best Regards,
Patrice
2020-11-02 12:38 AM
Dear @KKuma.4
As you do not answer, I guess you don't have to solve this problem anymore, therefore I consider this thread closed.
If not, feel free to reopen it by posting a new answer.
Best regards
Laurent Ca...