Hey,
in my company we want to use a PN5190 RFID reader working together with a STM32 MCU. Unfortunately i cannot get an answer from the PN5190 when i try to communicate to it via SPI. The problem is that the documentation of the PN5190 seems to be a bit imprecise when it comes to the structure of the spi communication (or i just don't get it right). So i am not hundred percent sure if i just communicate in a wrong way to the chip or maybe there is some other problem in hardware. So i tracked my outgoing SPI communication with logic analyzer (SendDieIDCmd_Logic_Analyzer.png and RcvDieID_Logic_Analyzer.png). I hope someone can tell me if my spi messages are wrong or if they should work and maybe there is some hardware related problem. Unfortunately i have no Eval board and the PN5190 Evalboard is out of stock at the moment. Otherwise i would buy it and look directly on the working SPI communication.
So the PN5190 circuit we use is shown in RFID_circuit.png. We're using 3.8V power supply (VSYS1). After startup, i first set VEN pin to high to enable the chip. After that i try to get the Die ID. But i always receive 0xFF. I also tried to get Version or write into and read from register like in Instruction Layer Datasheet Appendix A "Examples" (https://www.nxp.com/docs/en/data-sheet/PN5190_add.pdf). But none of them work. I also see that i never receive any interrupt from the IRQ pin.
Here is what my code lookes like to read the DieID (simplified):
/* TLV Header */
uint8_t MSG_FLOW_WRITE = 0x7F;
uint8_t MSG_FLOW_READ = 0xFF;
/* PN5190 Command/Response List */
uint8_t CMD_GET_DIEID = 0x26;
uint32_t TIMEOUT_SPI = 100;
/* Enable VEN Pin */
gpioRfidEn.WriteHigh();
/* Get Die ID
* send: 0x7F, 0x26, 0x00, 0x00
* recv: 0xFF, 0x26, 0x00, 0x03, 0x??, 0x??, 0x??
*/
uint16_t length = 0;
uint8_t* pLength = (uint8_t*)&length;
uint8_t writeBuf[] = { MSG_FLOW_READ, CMD_GET_DIEID, pLength[1], pLength[0] };
uint8_t readBuf[7] = { 0 };
rfidSpi.CsLow();
rfidSpi.Transmit(writeBuf, sizeof(writeBuf), TIMEOUT_SPI);
rfidSpi.CsHigh();
osDelay(100);
rfidSpi.CsLow();
rfidSpi.Receive(readBuf, sizeof(readBuf), TIMEOUT_SPI);
rfidSpi.CsHigh();
I hope someone could give me a hint at least it the problem is the way i build the messages. If you need further informations, let me know.
Unfortunately not. I received a private message from a NXP support engineer that they cannot support me because i used the RFID reader in combination with a STM32 MCU. I did not understand the reason for that becaue the question i asked was just related to the PN5190. After i realized that NXP will not support me with my problems i switched to another chip from another vendor and now everything works perfectly fine and i am more than happy with my decission.
Thank you for your reply, could you share the example mechanism of how to communicate pn5190 via spi? I understand that I need to use half duplex SPI, but all I got from pn is 0 bytes.
Thanks in advance.
Have you success communicate with pn5190?