MA702 SPI and Encoder simultaniously

Hello,
I am using a MA702, I seem to be having a problem reading the angle through SPI and using the encoder interface simultaneously.

With an STM32L4 chip, I am reading the angle through SPI with a looping DMA.
Meanwhile, I am using a hardware timer in encoder input mode to read the encoder output of the MA702 and trigger based on a capture compare register.

Operating individually, the encoder functions as expected. With a magnet on a BLDC motor, If I trigger off of the Z pulse on an oscilloscope, and output the timer interrupt based on encoder input I see a nice stationary square wave.

However, if I turn on the SPI/DMA to read the angle, now the signal from my timer slowly moves to the right on the scope. If I stop SPI/DMA reads, it stops moving.

I suspect the MA702 cannot handle both operations and is lagging. Is this known behavior that can be worked around, or do I need to refactor my code not to use the constant SPI/DMA stream?

1 Like