2022-12-11 09:51 AM
I can't see any other way to check whether CR95HF is in READY state rather then waking it up manually! Sounds nonsense to me, so I assume I'm missing something very important about it! Please, advise on any reasonable solution.
P.S. I'm using SPI.
Solved! Go to Solution.
2022-12-11 12:59 PM
Hi,
IRQ_OUT is the ST25R95/CR95HF interrupt output pin (pin 14).
See §4.1.2 in the ST25R95 datasheet for detail about this pin: "When the ST25R95 is ready to send back a reply, it sends an Interrupt Request by setting a low level on pin IRQ_OUT, which remains low until the host reads the data."
When the ST25R95/CR95HF is in tag detection mode, only the Low Frequency Oscillator is running. Therefore the SPI on ST25R95/CR95HF side is inactive until exiting from WFE mode. Once a reply is ready, the IRQ_OUT pin is set low until the MCU read the reply. I.e. the reading on the SPI by the MCU can only be done after the IRQ_OUT has been set low by the ST25R95/CR95HF.
For your information, the STSW-ST25R-LIB - ST25 embedded NFC library relies on IRQ_OUT for reading the responses on the SPI.
Rgds
BT
2022-12-11 12:25 PM
Hi,
when the ST25R95/CR95HF exits from Wait From Event (WFE) mode, it returns a result code and the wakeup source bit field. In order to be notified that a result code of the Idle command is available for reading, the application has to rely on IRQ_OUT. See §5.9 in the ST25R95 datasheet: "In low power consumption mode the device does not support SPI poll mechanism. Application has to rely on IRQ_OUT before reading the answer to the Idle command"
I would recommend to use the STSW-ST25R-LIB - ST25 embedded NFC library that provides an NFC communication stack with the support of the tag detection and the calibration of the tag detection.
Rgds
BT
2022-12-11 12:34 PM
Thanks, Brian!
But I am afraid that IRQ_OUT is intended only to avoid the polling during the SPI data transfer and has nothing to do with Tag Detect event! For IRQ_OUT to fire first you have to issue a HAL_SPI_Receive, and to use it you have to wake up the controller.
2022-12-11 12:59 PM
Hi,
IRQ_OUT is the ST25R95/CR95HF interrupt output pin (pin 14).
See §4.1.2 in the ST25R95 datasheet for detail about this pin: "When the ST25R95 is ready to send back a reply, it sends an Interrupt Request by setting a low level on pin IRQ_OUT, which remains low until the host reads the data."
When the ST25R95/CR95HF is in tag detection mode, only the Low Frequency Oscillator is running. Therefore the SPI on ST25R95/CR95HF side is inactive until exiting from WFE mode. Once a reply is ready, the IRQ_OUT pin is set low until the MCU read the reply. I.e. the reading on the SPI by the MCU can only be done after the IRQ_OUT has been set low by the ST25R95/CR95HF.
For your information, the STSW-ST25R-LIB - ST25 embedded NFC library relies on IRQ_OUT for reading the responses on the SPI.
Rgds
BT
2022-12-11 06:13 PM
Thanks a lot, Brian!
Your hint was very helpful! After numerous tries I managed to make it work as you've described!