Raspberry Pi to MPC5744p over SPI

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

Raspberry Pi to MPC5744p over SPI

964 Views
wouterj
Contributor I

Hello,

I am currently trying to get SPI data transfer between the MPC5744p and a Raspberry Pi 4 to work.

I'm using the SPIdev python toolkit to send the value 26 over to the MPC, using the attached SPItest.py script.

To receive this, i've modified the code of the SPI_MPC5744P example to only expect data arriving on the slave DSPI2.

When testing this my connections were as follows:

Raspberry Pi           NXP

SCLK                →   DSPI_2 CLK (PA0 - J5_1)

MOSI                 →   DSPI_2_SIN (PA2 - J5_5)

The code on the MPC5744P was intended to send a message to UART when SPI transfer has happened. However, when using the script on the Raspberry Pi, I could not get this message to show up.

I'm currently stuck as I can't seem to find out what I'm forgetting?

At first I thought that i also needed to connect the Slave Select pin, but the reference manual says that you shouldn't tie this to ground?

Thank you for your time.

Labels (1)
2 Replies

830 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Wouter,

the chip select must be asserted otherwise the SPI module ignores CLK and data pins.

I can remember there was a problem with continuous chip select when the module is configured as slave device. In this case, only first transmitted data was valid and then the slave module sent the same data again and again regardless of data written to PUSHR register. But the reception should work. If you don't want to transmit data, there should be no problem. But the chip select must be used. And notice that only chip select 0 can be used in slave mode.

Regards,

Lukas

831 Views
wouterj
Contributor I

Thank you for you reply Lukas.

It turns out that I was using chip select 1 and had a badly connected common ground. Connecting the RPI to CE0 as well as the RPI GND to the MPC5744p GND through a decent quality short cable got rid of the problem.

0 Kudos