SPI Master Slave communication with two EVB

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

SPI Master Slave communication with two EVB

1,030 Views
P007
Contributor II

Hi , 

I am using the S32K146EVB for LPSPI communication, In that I'm using the one EVB as a master and another EVB as a slave.

only half duplex is working.

Not getting the data from slave.

I also used the example code for master attached below.

community.PNG

0 Kudos
Reply
5 Replies

988 Views
P007
Contributor II

Thanks @danielmartynek  

I am using the DS32 ARM for this.
I have tried that example code .
Used that code in both slave and master EVB,
but only it is giving the data on MOSI.

0 Kudos
Reply

985 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Did you connect the right pins?

If you modified the example projects, please attached both projects here.

 

Or create a ticket if you don't want to share it publicly.

Make sure the lpspi transfer API on the Slave device is called before the Master starts the transfer.

The Slave must have data in the TX FIFO when the transfer starts.

 

Regards,

Daniel

0 Kudos
Reply

951 Views
P007
Contributor II

Hi @danielmartynek 

Please find the attached example codes, which I am using for communicating EVB.

0 Kudos
Reply

937 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @P007,

You configured both MCUs as SPI Masters.

And this is what you call in the Slave project you attached:

for(;;)
{
LPSPI1_16bits_read = LPSPI1_receive_16bits(); /* Receive half word on LSPI1 */
LPSPI1_transmit_16bits(tx_16bits); /* Transmit half word (16 bits) on LPSPI1 */
counter++;
}

As I have already mentioned, when the Master starts the transfer, the LPSPI TX FIFO on the Slave's side must be filled with data provided it is a full-duplex format. But your code is waiting for RX data instead.

Please use the SDK or RTD drivers at least for the Slave device.

 

Regards,

Daniel

0 Kudos
Reply

999 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Pankaj Unde,

In that case, there is something wrong with the Slave device.

Have you tried the SDK example instead?

It utilizes both Master and Slave in the one project.

danielmartynek_0-1695806794477.png

 

Regards,

Daniel

0 Kudos
Reply