SPI on S32K148

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SPI on S32K148

2,376 次查看
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,371 次查看
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,338 次查看
RishikeshB
Contributor II

What data are we actually sending in this

0 项奖励
回复

2,333 次查看
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 项奖励
回复