SPI on S32K148

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SPI on S32K148

2,341件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

2,336件の閲覧回数
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 件の賞賛
返信

2,303件の閲覧回数
RishikeshB
Contributor II

What data are we actually sending in this

0 件の賞賛
返信

2,298件の閲覧回数
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 件の賞賛
返信