Hello,
I am trying to transfer data from the ADC1_P0 from SPI_externalHW0_instance0 to SPI_externalHW1_instance1 via half duplex support. I have configured the SCK, PCS and the SIN and SOUT pins for the SPI instances.
When i run the program on 358 board, i am not able to transfer the ADC data from my TXbuffer to my RXbuffer even after initialising and setting the callbacks LPSPI_IP_HALF_DUPLEX_TRANSMIT and LPSPI_IP_HALF_DUPLEX_RECEIVE respectively.
Please find the attached project. Thanks in advanced. Soumik
Hi @soumik1506
A Lpspi_Ip_HalfDuplexTransfer sample code is provided with the RTDs. The application uses the LPSPI driver to transfer data between 2 LPSPI physical units in half-duplex mode.
This can be a good reference for SPI driver configuration.
BR, VaneB
I have also tried running the example code without making any changes in the code or in the configurations, the data is not getting transferred like i want to.
Hi @soumik1506
Could you share a picture of the SPI signals to verify if the information is being transferred?
This is the signal that is going from the LPSPI2_SOUT pin
This is the signal that is going from the LPSPI0_SIN pin
I have made sure that the configurations are exactly the same from the example. I have set the number of bytes to 1 instead of 10 just to check the data getting transferred.
I also went through each function call while debugging, the value that i want to transfer is not getting set in the TDR bit which further doesn't set the transfer complete flag.
Can you please tell where i am going wrong or what i am missing out. Why is this happening?
Hi @soumik1506
Sorry for the delay.
I was able to reproduce your problem, it seems that there is a problem with the pins used for MOSI, I need to do some further tests to verify this situation.
In the meantime, the workaround is to change the pins used. I changed PTF2 -> PTB27 and PTC9 -> PTE0.
Hi @soumik1506
Sorry for the inconvenience, but I am a bit confused, you mentioned "172 HDQFP package", but the EVB is a 289 MAPBGA package. Are you using a custom board?
Hi @soumik1506
I am sorry for any inconvenience this may cause you, but since the software works on our end, it seems to be a hardware issue with your board. Since we cannot reproduce it, it is very difficult to pinpoint a hardware issue through this support channel.
Unfortunately, the only general guidelines I can give you is to follow the Hardware Design Guidelines for S32K3xx Microcontrollers (S32K3 MCUs for General Purpose – Hardware Design Package) and check the S32K3X8EVB-Q289 Evaluation Board Design Files. You can also try configuring another board or MCU to rule out a faulty product.