This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC not working on payment readers

Hi all,

I am using SDK13 with NRF52DK. I am trying to get NFC to work with a reader and encountered some problems.

I have tried 3 different examples, record_text, writable_ndef_msg and wake_on_nfc. They all work properly with an android phone. However, in my application, I need to detect an NFC field from a payment reader. And it seems like only the wake_on_nfc example works. The record_text implements a Type 2 Tag while the writable_ndef_msg implements a Type 4 Tag.

The wake_on_nfc example uses BSP and it seems like it can only be used to wake up the MCU. In my application, my MCU needs to be awake while detecting the presence of a NFC field.

Has anyone managed to get NFC to work with other types of readers other that a mobile phone? Any ideas what I am doing wrong?

Edit: I just need to detect the presence of a NFC field and nothing else. I don't need any exchange of messages.

Parents
  • Hi,

    The NFCT peripheral will trigger an event if a field is detected when sensing mode is enabled. This short code shows how to enable sensing and interrupt for FIELDDETECTED event:

    #include <nrf.h>
    
    // This IRQ handler will trigger when NFC field is detected
    void NFCT_IRQHandler(void)
    {
      if (NRF_NFCT->EVENTS_FIELDDETECTED == 1)
      {
        NRF_NFCT->EVENTS_FIELDDETECTED = 0;
        //Field detected
      }
    }
    
    int main(void)
    {
        //Enable interrupt for FIELDDETECT Event
        NRF_NFCT->INTENSET = NFCT_INTENSET_FIELDDETECTED_Enabled << NFCT_INTENSET_FIELDDETECTED_Pos;
        
        //Register interrupt for NFCT module
        NVIC_EnableIRQ(NFCT_IRQn);
        
        //Start sensing 
        NRF_NFCT->TASKS_SENSE = 1;
        while(1)
        {
            // do nothing
        }
    }
    

    Best regards,

    Jørgen

Reply
  • Hi,

    The NFCT peripheral will trigger an event if a field is detected when sensing mode is enabled. This short code shows how to enable sensing and interrupt for FIELDDETECTED event:

    #include <nrf.h>
    
    // This IRQ handler will trigger when NFC field is detected
    void NFCT_IRQHandler(void)
    {
      if (NRF_NFCT->EVENTS_FIELDDETECTED == 1)
      {
        NRF_NFCT->EVENTS_FIELDDETECTED = 0;
        //Field detected
      }
    }
    
    int main(void)
    {
        //Enable interrupt for FIELDDETECT Event
        NRF_NFCT->INTENSET = NFCT_INTENSET_FIELDDETECTED_Enabled << NFCT_INTENSET_FIELDDETECTED_Pos;
        
        //Register interrupt for NFCT module
        NVIC_EnableIRQ(NFCT_IRQn);
        
        //Start sensing 
        NRF_NFCT->TASKS_SENSE = 1;
        while(1)
        {
            // do nothing
        }
    }
    

    Best regards,

    Jørgen

Children
No Data
Related