is it possible to turn RF field on without pn532 going into power down mode?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

is it possible to turn RF field on without pn532 going into power down mode?

1,354 Views
evelineververga
Contributor I

Dear fellow programmers,

For my team test suite (a project for school) it is required to turn the RF field on (on the Adafruit pn532 break out board).

I found a way to turn it on, but it refuses to stay on: (partial of the code comes from the adafruit pn532 library)

bool AdafruitPn532Extended::SetFieldOn()

{

  commandbuffer[0] = PN532_COMMAND_RFCONFIGURATION;

  commandbuffer[1] = 0x01;

  commandbuffer[2] = 0x01;

  if (!sendCommandCheckAck(commandbuffer, 3))

  {

     return 0x0;  // no ACK

  }

  return 1;

}

I also tried:

bool AdafruitPn532Extended::CheckForReadableTarget()

{

  uint16_t timeout = 0;

  //setPassiveActivationRetries(0xFF);

  commandbuffer[0] = PN532_COMMAND_INLISTPASSIVETARGET;

  commandbuffer[1] = 1;  // max 1 cards at once (we can set this to 2 later)

  commandbuffer[2] = PN532_MIFARE_ISO14443A;

  if (!sendCommandCheckAck(commandbuffer, 3, timeout))

  {

    return 0x0;  // no cards read

  }

  return 1;

}

With this code it works once, then I have to manual remove the tag or adafruit-PN532 breakout shield in order for it to work again.

My best guess is, it's either the first one where power down mode has to be turned off in a way. Or the second option where most probably I have to trick the RF field detection into thinking a new tag was placed in the field.

I thank you very much for your time.

Tags (2)
0 Kudos
1 Reply

843 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Eveline:

I am not familiar with the library you are using, but I can make some comments about the functions you show above:

1) The SetFieldOn() function looks good (if the macro PN532_COMMAND_RFCONFIGURATION is correct). This function should leave the RF Field ON, unless there is something in the rest of your code that is turning the RF Field off again.

2) The InListPassiveTarget() command behavior can be configured with the MxRtyPassiveActivation setting. If you set this parameter to 0xFF using the RFConfiguration command then the PN532 will try infinitely to activate a target and the RF Field will be ON meanwhile.

I hope this helps!

Regards,

Jorge Gonzalez

0 Kudos