iMXRT: LPSPI Communications

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

iMXRT: LPSPI Communications

476 Views
Sam_ECU
Contributor IV

Hello NXP,

I've reviewed the SPI examples that are available with the MBDT Toolbox, but I'm trying to make the jump to communicating with the MC33813.

First question, are there any examples available showing the iMXRT actually communicating with a device with register addressing and transmitting more the 8-Bit etc?

In the MC33813 datasheet the device should be polled and the read and write requests are 16-Bit, responses are also in 16-Bit.

How should the SPI-Block in Simulink be set up for 16-Bit communication. For example, would something like this be acceptable / recommended?

Sam_ECU_0-1670176394154.png

Are there any examples or recommendations in regards to a sequence of communication requests? For example, the MC33813 has registers for the faults. What's the MBDT recommended way to work through the list and send read requests to each of the fault registers one after another? How could that potentially work with eDMA and PIT?

Sam_ECU_4-1670176620601.png

How does MCU_Config need to be set up to allow multiple CS on the LPSPI1?

The maximum SPI clock frequency for MC33813 is 8 Mhz, but 1 MHz appears to be recommended. Are they're any NXP recommendations on how the LPSPI Clock should be set up or things to be mindful of?

Sam_ECU_3-1670176534561.png

 

Sam_ECU_1-1670176440143.png

 

Regards,
Sam

P.S. There's potentially an error in the reference manual (Prescale Factor)

Sam_ECU_2-1670176456464.png

 

0 Kudos
2 Replies

406 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Sam_ECU,

We do not have any examples of 16 bit SPI communication for MBDT, however your solution of concatenating two bytes is useful to work as a 16 bit bus.

I didn't really understand what you mean by "What's the MBDT recommended way to work through the list and send read requests to each of the fault registers one after another?" however. Could you please specify?

You should be able to run the MC33813 at 8MHz without issue. It is only noted that our tests were dont at 1MHz, but if the statement is that the max frequency is 8MHz, then there is no issue doing that.

 

BR,

Edwin.

0 Kudos

453 Views
Sam_ECU
Contributor IV

To my question "How does MCU_Config need to be set up to allow multiple CS on the LPSPI1?"

- The CSx Pin needs to be assigned, then the CSx can be seen in the peripheral menu

0 Kudos