SPI Communication with S32K116 host MCU
Hello everyone,
I am trying to communicate with ST25R3920 using S32K116 host MCU. I managed to read some data but they seem meaningless according the datasheet. For example:
I was trying to read IC identity register(3Fh) to test that if I am able to communicate with the device. When I send 3Fh with 01 prefix for read operation, I read 15h(00010101b) on second byte of buffer. That made me thought maybe I am losing bits during communication because I should read 2Ah(00101010) but then I realized when I to read different registers I get the same 15h value on different byte( like 3rd or 6th byte of receive buffer) and this value is meaningless for that registers.
I tried to configure default options and run the power-up sequence properly but I don't even know if they are executed in right way. I am tagging a snippet that I use to send data to ST25R3920.
So, I was not able to detect the problem causing this issue. What are the options I could try and what could be the issue? I'd appreciate any help if you have an opinion on this topic. Thanks in advance!
Edit: I didnt know what information should I provide here and didn't want to make the question too long. Make me know if you need more information and I will try to provide with my best knowledge.
Best regards,
Furkan
/* OP_READ is prefix for read operation ( 0x01 << 6 ) */
spiTxBuffer[0] = (OP_READ) | 0x3E;
/* Pull BSS down to start communication */
BOARD_SetPin(GPIO_NFC_BSS, RESET);
status = LPSPI_DRV_MasterTransferBlocking(LPSPICOM1, spiTxBuffer, spiRxBuffer, SPI_BUFFER_SIZE, TIMEOUT);
if ( STATUS_SUCCESS == status )
{
LPSPI_DRV_MasterAbortTransfer(LPSPICOM1);
BOARD_SetPin(GPIO_NFC_BSS, SET);
memset(spiTxBuffer, 0, SPI_BUFFER_SIZE);
}