Skip to main content
RDien
Associate III
December 11, 2022
Solved

How one should know that CR95HF has returned to READY state in Tag Detection mode?

  • December 11, 2022
  • 4 replies
  • 1282 views

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.

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    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

    4 replies

    Brian TIDAL
    ST Technical Moderator
    December 11, 2022

    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

    In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
    RDien
    RDienAuthor
    Associate III
    December 11, 2022

    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.

    Brian TIDAL
    Brian TIDALBest answer
    ST Technical Moderator
    December 11, 2022

    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

    In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
    RDien
    RDienAuthor
    Associate III
    December 12, 2022

    Thanks a lot, Brian!

    Your hint was very helpful! After numerous tries I managed to make it work as you've described!