CLRC663: Discovery loop for Poll Mode takes High CPU Usage

cancel
Showing results for 
Search instead for 
Did you mean: 

CLRC663: Discovery loop for Poll Mode takes High CPU Usage

190 Views
Contributor I

Hi,

We are using AM335x based custom board. We have connected CLRC663 RFID card reader to the I2C lines. and we have integrated RFID NFC Reader Library in our application. everything works fine. We are able to read/write the Mifare Classic RFID card's memory. We have used the Discovery loop to detect the RFID card. below is the code snippet for that.

---------------------------------------------------------------------------------------------------------------

do
{
    /* Field OFF */
   status = phhalHw_FieldOff(pHal);
   CHECK_STATUS(status);

   /* Polling interval for the card detection */
   sleep(1);

   /* Configure Discovery loop for Poll Mode */
   status = phacDiscLoop_SetConfig(pDiscLoop,
                PHAC_DISCLOOP_CONFIG_NEXT_POLL_STATE,
                PHAC_DISCLOOP_POLL_STATE_DETECTION);
    CHECK_STATUS(status);

    /* Run Discovery loop */
    status = phacDiscLoop_Run(pDiscLoop,
    PHAC_DISCLOOP_ENTRY_POINT_POLL);

    /* Exit on Card detection */
} while ((status & PH_ERR_MASK) != PHAC_DISCLOOP_DEVICE_ACTIVATED);

---------------------------------------------------------------------------------------------------------------

Now, the problem is above code takes around 10% CPU usage

Can you guys suggest to us, How we can reduce the CPU usage?  Do we have any other method to detect the RFID card, other than the DIscovery loop? 

Regards,

Sandip 

 

0 Kudos
5 Replies

101 Views
Contributor I

Hi,

Your wise answer can solve our problem. Please reply

 

Regards,

Sandip

0 Kudos

177 Views
NXP Employee
NXP Employee

Hi Sandip,

 

Hope you are doing well. There are two Application Notes that could help you:

Hope this helps.

 

Regards,

Ricardo

0 Kudos

164 Views
Contributor I

Hi Ricardo,

Thanks for the answer, but the documents which you have shared don't give an answer to the questions. Below are my questions.

1) Why the Discovery loop is taking too much CPU usage.

2) Is our implementation of card detection logic is correct. or there is another way to implement the same logic? so that we can reduce CPU usage.

 

Thanks,

Sandip

0 Kudos

152 Views
NXP Employee
NXP Employee

Hi Sandip,

 

The CPU usage depends on the host MCU, and it is something we cannot help you with, as it is not from NXP. The documents would help you to scale down the reader library, or to use the CLRC663 without the library in case you don’t want to use it.

 

The simplest example is the Basic Discovery Loop Example.

 

Regards,

Ricardo

0 Kudos

123 Views
Contributor I

Hi Ricardo,

I got your point. but my question is I am continuously polling for the RFID card using the Discovery loop. that polling logic uses the high CPU bandwidth. I have added the code snippet in the question.

So, I want to know that, Is there any event type mechanism is there in NXP RFID library so that I don't want to continuously poll for the RFID card. or Do we have any provision in the discovery loop? by using that we can implement it on the event-based?

Thanks,

Sandip

 

0 Kudos