S32K144 control brushed motor Encountered an interrupt overflow issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K144 control brushed motor Encountered an interrupt overflow issue

872 次查看
TerenceBill
Contributor I

使用PWM触发PDB的ADC转换,并在PDB中断程序中进行motor的运算控制,因为使用了SPI通信,改变预驱DRV8718的参数,发现多次发送SPI的通信会导致中断栈溢出是什么问题。

When using PWM to trigger PDB for ADC conversion and performing motor control operations with PDB interrupt, the issue of interrupt stack overflow occurs due to multiple SPI communications to change the parameters of the pre-driver DRV8718。

其中,各个功能模块的时序配置如下:

模块周期时间

PWM10kHz100us
PDB20kHz50us
SPI5Mhz200ns
OSIF800Hz1.25ms

 

其中,SPI的发送使用的中断发送的方式。

Among them, the SPI transmission uses the interrupt-driven transmission method.

目前在PDB中发送一次SPI的通信是可以使用的,发送两次就会导致中断异常。PDB中的电机运行的计算已经屏蔽了,只保留了SPI的通信,还是不行。

Currently, sending a single SPI communication via PDB works fine, but sending twice leads to interrupt anomalies.The motor operation calculations in the PDB have been disabled, leaving only the SPI communication, but the issue still persists.

SPI主要修改的是电机的运行方向。

The SPI mainly modifies the running direction of the motor.

应给如何设计各个模块的时序,可以保证SP可多次通信,并且不影响PDB的运行。

标记 (1)
0 项奖励
回复
3 回复数

844 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Are you talking about some NXP motor kit or your own design?

Is it DC motor?

Best regards,

Peter

0 项奖励
回复

809 次查看
TerenceBill
Contributor I

use my design to control the dc motor.The main question is whether it is possible to send SPI data to control the modification of the pre - driver ( change the motor direction) during a PDB interrupt.

0 项奖励
回复

782 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Not sure about which pre-driver you are talking.

But, yes SPI data can be sent.

Best regards,

Peter

0 项奖励
回复