SPI SDK example lpspi_transfer_s32k144 ( Not able to communicate continuously)

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

SPI SDK example lpspi_transfer_s32k144 ( Not able to communicate continuously)

跳至解决方案
959 次查看
KARTHKSARODE
Contributor III

Hi Team

As stated in the subject , I'm trying to run the LPSPI sdk example code lpspi_transfer_s32k144

I have connected the pins perfectly 

* B0-D3
* B2-B14
* E1-D2
* B4-D1

So once the run the program , i could able to see the adc value from potentiometer & same is been sent from slave to master perfectly

But next time , if i modify the potentiometer , adc value is getting modified , so slave is trying to send updated adc value to master 

But master is not able to read the current value , it is storing the first adc value 

Please let me know , If modifications has to be done

 

Best Regards

Karthik SV

Best Regards
KARTHIK SV
标记 (3)
0 项奖励
1 解答
928 次查看
KARTHKSARODE
Contributor III

Hi Jim

Now I'm able to communicate continuously, earlier I had powered up EVB with 12V external supply

Later I connected only USB , It is able to communicate perfectly 

Can you tell me , what may be reason for that , As LPSPI1 is connected to CAN transreceiver , external supply is turning on the transreceiver , so 2 SPI devices are connected to LPSPI1(LPSPI0 & CAN transreciver) 

Best Regards
KARTHIK SV

在原帖中查看解决方案

0 项奖励
4 回复数
950 次查看
KARTHKSARODE
Contributor III

Adding to above , I found out that , after first byte gets transmitted successfully , Status register MBF bit is having "LPSPI is busy"

That is a reason why it is not able to recieve next byte 

Please let me know , how to make "LPSPI idle again" , i tried clearing RDF bit 

Still it was showing "LPSPI is busy"

 

Regards

KARTHIK SV

Best Regards
KARTHIK SV
0 项奖励
938 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@KARTHKSARODE

Is you debugger reading the RX FIFO? 

you can close the register view window and then try again.

 

Read and w1c RDF ,for example:

if(LPSPI1->SR & LPSPI_SR_RDF_MASK)
{
    LPSPI1->SR |= LPSPI_SR_RDF_MASK; 
}

 

BR!

      Jim,

0 项奖励
929 次查看
KARTHKSARODE
Contributor III

Hi Jim

Now I'm able to communicate continuously, earlier I had powered up EVB with 12V external supply

Later I connected only USB , It is able to communicate perfectly 

Can you tell me , what may be reason for that , As LPSPI1 is connected to CAN transreceiver , external supply is turning on the transreceiver , so 2 SPI devices are connected to LPSPI1(LPSPI0 & CAN transreciver) 

Best Regards
KARTHIK SV
0 项奖励
913 次查看
Guofred
Contributor III

Hi @KARTHKSARODE ,

Thanks for sharing the information. 

if some chips were broken, we couldn't be normal communicate by using 12V or USB.

so may be we can measure the 12V external supply during the communicate.

and compare the result between 12V external supply and USB.

small idea for you reference, kindly help to share your comments, thanks.

Guofred_0-1644937047891.png

Best regards.

Guofred

 

0 项奖励