SPI SDK example lpspi_transfer_s32k144 ( Not able to communicate continuously)

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

SPI SDK example lpspi_transfer_s32k144 ( Not able to communicate continuously)

Jump to solution
921 Views
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
Tags (3)
0 Kudos
1 Solution
890 Views
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

View solution in original post

0 Kudos
4 Replies
912 Views
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 Kudos
900 Views
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 Kudos
891 Views
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 Kudos
875 Views
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 Kudos