SPI on S32K148

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

SPI on S32K148

752 Views
RishikeshB
Contributor II

Hello NXP 

I am working on S32K148 for SPI 

How to configure SPI in master mode only and how to check the output result 

I don't have any slave Device.

Is there any sample code?

 

0 Kudos
Reply
3 Replies

747 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@RishikeshB

please take a try the demo:lpspi_transfer_s32k148

The application uses two on board instances of LPSPI, one in master configuration and the other one is slave to communicate data via the SPI bus. Data will be gathered periodically from the ADC input and will be sent to the master device which transforms it into a PWM signal. In this way the potentiometer controls the LED intensity.

I have tested this routine and the waveforms tested by the oscilloscope are all working fine!

0 Kudos
Reply

714 Views
RishikeshB
Contributor II

What data are we actually sending in this

0 Kudos
Reply

709 Views
Senlent
NXP TechSupport
NXP TechSupport

an 8-bit data:

uint8_t slaveDataSend;

slaveDataSend = (uint8_t)adcRead;
LPSPI_DRV_SlaveTransfer(RECEIVE, &slaveDataSend, &slaveDataReceive, BUFFER_SIZE);

0 Kudos
Reply