Motor control ADC fast loop affecting SPI DMA operations

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Motor control ADC fast loop affecting SPI DMA operations

429 Views
Haitham_Ismail
Contributor III

Hello,

I ported the mc pmsm sdk application to FreeRTOS, and it is working fine. Now, I added a task that configures the spi interface, dma major loops and enables the dma request for the required channels to read samples from an analog front end. The dma interrupt is used to reconfigure the major loop number and signal end of transfer when the number of samples required is received.

Currently the analog front end is connected to a signal generator and not to the motor.

The transfer between the analog front end and the evaluation board works fine until I use freeMASTER to start the motor. The values read from the analog front end become faulty (the decoded value is different on the oscilloscope too). I Checked the registers of the analog front end and they set are as required and do not change when the readings become faulty.

If I request speed 0 using freemaster (speed control), the values read from the analog front end stay correct. Values other than that (usually above 1000rpm) will cause the readings to become faulty.

I tried using different priorities for the tasks and interrupts but nothing helped yet.


References used to port to FreeRTOS:

https://github.com/nxp-appcodehub/ap-qmc2g-industrial

https://www.nxp.com/docs/en/application-note/AN12881.pdf

https://www.nxp.com/docs/en/application-note/AN5309.pdf

iMXRT1170

0 Kudos
1 Reply

387 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

Unfortunately we do not have an app note for motor control and FreeRTOS with the RT1170, which you can take as a reference. But from what you say, maybe it's just the interrupt processing of the UART which invokes FreeMaster task.

Have a nice day!

0 Kudos