Skip to main content
KAgga.1
Associate III
July 18, 2023
Solved

How to use ST25R95 in Interrupt mode

  • July 18, 2023
  • 2 replies
  • 1819 views

Hello!
I'm using ST25R95 with X-CUBE-NFC3 library for an application.
I have successfully tried the default PollingTagDetect example. But now, our application requires the usage of interrupt mode for card detection instead of looping NFC_Cycle(); in infinite loop.
Application is to just read the UID of the card.

@Brian TIDAL @unknown 
Any help will be appreciated.
Regards,
Keshav Aggarwal

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

Hi,

Regarding the wake up  configuration, I would suggest to use the default configuration (discParam.wakeupConfigDefault = true).

Regarding the NFC_Cycle: you need to loop on NFC_Cyle except when the wake up mode is entered (if you use a sequencer, you can run NFC_Cyle every millisecond and do other tasks meanwhile). When entering the wake up mode, you just need to enable the interrupt.

 

Rgds

BT

2 replies

Brian TIDAL
Technical Moderator
July 18, 2023

Hi,

"Application is to just read the UID of the card." Which tag technology is being used? NFC-A/B/F or V?

"But now, our application requires the usage of interrupt mode for card detection instead of looping NFC_Cycle(); in infinite loop." Is your concern linked to low power mode i.e. you want to have the MCU being in sleep mode and be waken up by a interrupt?

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.
KAgga.1
KAgga.1Author
Associate III
July 18, 2023

Thanks for replying.

"Which tag technology is being used? NFC-A/B/F or V?"
NFC-A

"Is your concern linked to low power mode i.e. you want to have the MCU being in sleep mode and be waken up by a interrupt?"
Our main concern is to offload CPU to perform other tasks in idle mode without affecting the NFC performance.

BR,
Keshav Aggarwal

Brian TIDAL
Technical Moderator
July 18, 2023

Hi,

I would suggest to enable the wake up mode of the ST25R95 (set discParam.wakeupEnabled to true in demoIni). The ST25R95 device will enter into tag detection mode. Once a tag is entering into the operating field, the IRQ_OUT will be raised. Once this IRQ_OUT is raised, you just need to restart looping the demoCycle loop to read the UID until the tag is removed from the operating field and device returns to wake up mode (see RFAL_NFC_STATE_WAKEUP_MODE in demoNotif). Make sure to configure the ST25R95_N_IRQ_OUT_PIN in EXTI interrupt mode and to enable the interrupt while being in wake up mode.

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.
KAgga.1
KAgga.1Author
Associate III
July 19, 2023

Hello!
I understood your point. But will I still need to keep the NFC_Cycle() in loop? Actually, I don't want to do that.
Kindly verify the attached code for it.

Best Regards,
keshav Aggarwal

Brian TIDAL
Brian TIDALBest answer
Technical Moderator
July 19, 2023

Hi,

Regarding the wake up  configuration, I would suggest to use the default configuration (discParam.wakeupConfigDefault = true).

Regarding the NFC_Cycle: you need to loop on NFC_Cyle except when the wake up mode is entered (if you use a sequencer, you can run NFC_Cyle every millisecond and do other tasks meanwhile). When entering the wake up mode, you just need to enable the interrupt.

 

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.