NTAG NT3H2211 FD Pin: Field off is not detected in pass-through mode

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

NTAG NT3H2211 FD Pin: Field off is not detected in pass-through mode

Jump to solution
1,266 Views
knigro
Contributor I

Hello,

I am using the NT3H2211 in pass-through mode in the following way:

Initially at software startup, Session Register NC is configured as follows:

FD_OFF = 00b
FD_ON = 00b
PTHRU_ON_OFF = 0b
TRANSFER_DIR = 0b

According to Table 13 in NT3H2111_2211 product data sheet at this state the field detection pin (FD) should only signal when a field is switched on or off. And in my device this does work correctly, FD pin gets low when field is switched on, FD pin gets high when field is switched off and I can handle that with software interrupts.

knigro_1-1655205029104.png

As soon as the field is detected, the device shall configure the NT3H2211 to be used for communication using the pass-through mode. This is done as follows: 

FD_OFF = 11b
FD_ON = 11b
PTHRU_ON_OFF = 1b
TRANSFER_DIR = 1b

According to table 13 the FD pin should now signal HIGH if the field is switched off, last data is read by I2C (NFC->I2C) or last data is written by I2C (I2C->NFC).

Also the FD pin should now signal LOW if last data is ready to be read by I2C (NFC->I2C) or data is read by NFC (I2C->NFC).

At this point, signaling end of reading or writing on the FD pin does work properly. But the FD pin does not change when the field is switched off. I can turn off and on the Card Reader and there is no change in the FD pin, so I am not able to detect that the field is not there anymore.

What am I doing wrong?

0 Kudos
1 Solution
1,038 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Knigro:

 It is correct. If NFC field goes OFF during NFC -> I²C pass-through transfer, host cannot determine from FD pin that NFC field is off.

Anyway, chunk transfer from NFC -> I²C at that point is completed. If host needs to know if NFC field is there, it shall poll after some idle time for RF_FIELD_PRESENT.

danielchen_0-1658239046418.png

 

Regards

Daniel

View solution in original post

Tags (1)
0 Kudos
7 Replies
1,065 Views
knigro
Contributor I

Hello,

here is a code sample, which explains what I want to do and what does not work how I expect it to work. Maybe someone can see what is wrong there.

#include "nfc_app2.h"
#include "nt3h2x_i2c.h"

#include <string.h>

static bool readSessionRegister_NS();
static bool readSessionRegister_NC();
static bool writeSessionRegister_NC();

static sReg_NS_REG_t sessionRegister_NS;
static sReg_NC_REG_t sessionRegister_NC;

static volatile bool isInitialized = false;

bool NFC_APP2_Init(void)
{
bool result = false;
isInitialized = false;

/* Initialize I2C interface to NT3H2x */
if (NT3H2x_I2C_Init() != true)
{
return false;
}

/* Configure FD_OFF/ON to 00b each. For this sample it is doesn't matter if they
* are configured to 01b or 10b each, also tried FD_OFF = 11b and FD_ON 10b as
* initial configuration.
*/
sessionRegister_NC.FD_OFF = 0;
sessionRegister_NC.FD_ON = 0;
sessionRegister_NC.NFCS_I2C_RST_ON_OFF = 0;
sessionRegister_NC.PTHRU_ON_OFF = 0;
sessionRegister_NC.SRAM_MIRROR_ON_OFF = 0;
sessionRegister_NC.TRANSFER_DIR = 0;

if (writeSessionRegister_NC() != true)
{
return false;
}

memset(&sessionRegister_NC, 0, sizeof(sReg_NC_REG_t));
memset(&sessionRegister_NS, 0, sizeof(sReg_NS_REG_t));

readSessionRegister_NC();
readSessionRegister_NS();

isInitialized = true;

return result;
}

bool NFC_APP2_IsInitialized(void)
{
return isInitialized;
}

/* This handler is called always when the pin state of FD Pin has changed
* I want to use this as trigger for communication state machine */
void NFC_APP2_HandleProtocol(bool fdPinState_LOW)
{
static bool oldFDPinState_LOW = false;

readSessionRegister_NS();
readSessionRegister_NC();

if (fdPinState_LOW != oldFDPinState_LOW && fdPinState_LOW == true)
{
if (sessionRegister_NC.PTHRU_ON_OFF == 0)
{
/* Enable pass-through mode */
sessionRegister_NC.FD_OFF = 3;
sessionRegister_NC.FD_ON = 3;
sessionRegister_NC.PTHRU_ON_OFF = 1;
writeSessionRegister_NC();

/* After configuring FD_OFF and FD_ON to 11b each, field switching off is not detected anymore,
* that means this handler is not called when the field switches off. This makes it impossible
* to detect field switching off during ongoing pass-through communication.
*/
}
}

oldFDPinState_LOW = fdPinState_LOW;
}

static bool readSessionRegister_NS()
{
bool result = NT3H2x_ReadRegister(eREGISTER_SESSION, NT3H2X_SESSION_REG_NS_REG, (uint8_t*)&sessionRegister_NS);

return result;
}

static bool readSessionRegister_NC()
{
bool result = NT3H2x_ReadRegister(eREGISTER_SESSION, NT3H2X_SESSION_REG_NC_REG, (uint8_t*)&sessionRegister_NC);

return result;
}


static bool writeSessionRegister_NC()
{
bool result = NT3H2x_WriteRegister(eREGISTER_SESSION, NT3H2X_SESSION_REG_NC_REG, *((uint8_t*)&sessionRegister_NC));

return result;
}

0 Kudos
1,039 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Knigro:

 It is correct. If NFC field goes OFF during NFC -> I²C pass-through transfer, host cannot determine from FD pin that NFC field is off.

Anyway, chunk transfer from NFC -> I²C at that point is completed. If host needs to know if NFC field is there, it shall poll after some idle time for RF_FIELD_PRESENT.

danielchen_0-1658239046418.png

 

Regards

Daniel

Tags (1)
0 Kudos
1,031 Views
knigro
Contributor I

Hi Daniel Chen,

yes, figured that out also and worked around with polling the FIELD_PRESENT flag. Thank you.

Regards,

Robert

0 Kudos
1,170 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Knigro:

Please check AN11579:  There is an example for Pass-Through mode transfer, FD_ON=3, FD_OFF=3

danielchen_0-1655871595658.png

 

https://www.nxp.com.cn/docs/en/application-note/AN11579.pdf

 

Regards

Daniel

 

0 Kudos
1,127 Views
knigro
Contributor I

Hello Daniel,

I actually followed the AN11579 for implementation. But the issue I have on my device is not covered by the application note. The closest hint I did found is in the table attached in the case description. As I understand, when configured as

FD_OFF = 11b

FD_ON = 11b

the FD pin should signal end of reading and writing as well as field switching off/on. But on my side, it does only signal end of reading and writing, not field switching. Unfortunately, I do not have a NTAG I2C Explore kit available.

Best regards,

Robert

0 Kudos
1,243 Views
knigro
Contributor I

I've checked also on the scope: As long as the FD_OFF and FD_ON are configured as 00b each, the FD Pin signals correctly field switching off and on. When FD_OFF and FD_ON are configured as 11b, FD Pin only signals reading and writing end, but not field switching. 

Additionally, when the field was switched off and switched on again, PTHRU_ON_OFF becomes 0b.

0 Kudos
1,238 Views
knigro
Contributor I

I still could not fix this.

I worked around with periodically checking for FIELD_PRESENT, otherwise I currently have no chance to get to know if the field is switched off in pass-through mode.

If anyone has an idea what I could try in addition or tell me what I am doing wrong, please let me know.

0 Kudos