S32K1 LPSPI half duplex without using SDK or RTD

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

S32K1 LPSPI half duplex without using SDK or RTD

Jump to solution
417 Views
Jembed
Contributor II

Hello @danielmartynek,

I want to use S32K148 LPSPI module to communicate with a RF module. I don't want to use SDK or RTD drivers. The module interface is based on 3-wire SPI (half duplex). The communication method is that first I send a byte(register address) on the data line and then the slave module puts a byte(register read data) on the SDIO (data line) in response. 

The image below is a part of the slave module datasheet. As shown in the picture, the manufacturer recommends that the MCU changes the state of its data line to the input before the last falling edge of the clock, so that it does not overlap with the time, slave turns to output state (which occurs after the mentioned falling edge). 

Jembed_0-1700367835846.png

 

As I have specified in the image above, I guess that the MCU changes the state of the SDIO line to input, after the recommended edge, and there is an interval of time in which both sides are at output state.

I want to use the register level routine, introduced in this topic:

https://community.nxp.com/t5/S32K/S32K-3-Wire-SPI-Drivers/td-p/1342666

What should I do to make sure that the warned contention will not occur on the SDIO line?

Thanks a lot

0 Kudos
1 Solution
350 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Jembed,

Please find my test project attached.

It sends one 16b frame (RXMSK = 1) and reads one 16bit frame (TXMSK = 1) in continous mode (CPHA = 0, CPOL = 0, PINCFG = 2, OUTCFG = 1 ).

SOUT (PTB16) is connected to a voltage divider, SOUT = 2.7V in High-Z mode.

As you can see, the SOUT is released (High-Z) at the last falling edge of SCK.

danielmartynek_0-1700661299534.png

 

Regards,

Daniel

 

View solution in original post

0 Kudos
3 Replies
351 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Jembed,

Please find my test project attached.

It sends one 16b frame (RXMSK = 1) and reads one 16bit frame (TXMSK = 1) in continous mode (CPHA = 0, CPOL = 0, PINCFG = 2, OUTCFG = 1 ).

SOUT (PTB16) is connected to a voltage divider, SOUT = 2.7V in High-Z mode.

As you can see, the SOUT is released (High-Z) at the last falling edge of SCK.

danielmartynek_0-1700661299534.png

 

Regards,

Daniel

 

0 Kudos
321 Views
Jembed
Contributor II
Hi @danielmartynek,
Thanks for your response. Is this behavior confirmed in the S32K1 reference manual or any other official documents from NXP?
0 Kudos
314 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Jembed,

It is not explicitly stated in the S32K1xx documentation.

 

Regards,

Daniel

0 Kudos