I’ve having an issue where SPI comms are unreliable when I power up some high voltage motors on the same system. I’ve got SPI communication going back and forth between the MPU and MCU with 100% success rate when I have only the FlexBench turned on with my 12V sensors powered. When I turn on the actuators for the vehicle on the 48V and high voltage busses, I start to get really terrible SPI comms. I’ve played around with which SPI mode is selected in the SPI master transmit block on the Simulink side as well as the CPOL and CPHA parameters on the MCU side. It seems like any variety of these parameters (surprisingly) allow for transmission when the motors are not powered but don’t seem to be making any difference when the motors are active.
SPI settings:
Bus Speed: 500 kHz
Message Length: 228 bytes
Send interval: 0.01 seconds
I’m programming both MCU and MPU with MATLAB 2023a at this point, in case there are any issues there.