cancel
Showing results for 
Search instead for 
Did you mean: 

Hall Sensor Encoder Issue - Left Motor Intermittent on STM32H723

rohitkushah
Associate

Hi everyone,

I'm using an STM32H723 for a project with Hall sensor encoders on two BLDC motors.

**Hardware:**
- Left motor: PE7, PE8, PE9 (U,V,W)
- Right motor: PD3, PD4, PD2 (U,V,W)

**Problem:**
Right motor encoder works perfectly. Left motor has issues:
1. Tick count is much lower than right motor (82 vs 236 ticks for same movement)

**Debug Output:*ENC:0,1|DIR:STOP,CW ← Left STOP, Right moving
ENC:6,11|DIR:CW,CW ← Both OK briefly
ENC:8,21|DIR:STOP,CW ← Left STOP again
ENC:82,236|DIR:CW,CW ← Huge tick difference

**What I've Tried:**
- Added debouncing
- Removed direction reset on invalid transitions
- Verified signals on oscilloscope (clean)
- External pull-ups (4.7kΩ)

**Key Difference:**
- Right motor: Dedicated EXTI2, EXTI3, EXTI4 handlers → WORKS
- Left motor: Shared EXTI9_5_IRQHandler for all 3 pins → PROBLEMS

**Questions:**
1. Can shared EXTI9_5_IRQHandler cause missed transitions when two pins change simultaneously?
2. Should I move left motor to pins with dedicated EXTI lines (0-4)?
3. Is there any way to get individual handlers for EXTI7/8/9 on H7 series?

**Code snippet (EXTI9_5 handler):**
```c
void EXTI9_5_IRQHandler(void) {
if (__HAL_GPIO_EXTI_GET_IT(L_HALL_U_PIN) != RESET) {
Hall_ProcessLeft(Hall_ReadLeftRaw());
}
// Same for V and W pins
}
Any suggestions would be greatly appreciated!

Thanks

1 REPLY 1
GMA
ST Employee

Hello @rohitkushah,

Check the NVIC priority level settings of the interrupts associated with the HALL sensor.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA