Greetings everyone,
I am using NT3H2211 NFC transponder in my STM32 project. I can successfully read/write registers, and I can detect FD pin change using an interrupt.
Hardware-wise:
SDA, SCL, and FD have a 10k pullup resistor.
Vcc is connected to 3.3 V and GND is connected.
Vout pin is left floating (not connected) because I don't use energy harvesting yet.
The antenna is from a referent design, and it works with the om5569/nt322erm explorer kit, so no problems there.
In the NTAG I2C Demo android application, I go to the SPEED tab, and when I select EEPROM test, it performs the test successfully. But when I select SRAM it says: Phone sends too fast or Tag was lost
I am using original code from official examples (SW3647.zip), but the only difference that I know of, is the following function.
Original function:
uint8_t NTAG_WaitForFDPinState(NTAG_FD_STATE_T state, uint32_t timeout_ms) {
switch (state) {
case NTAG_FD_PIN_STATE_HI:
HAL_ISR_RegisterCallback(ntag->isr, ISR_LEVEL_HI, NULL, NULL);
return HAL_ISR_SleepWithTimeout(ntag->isr, timeout_ms);
case NTAG_FD_PIN_STATE_LO:
HAL_ISR_RegisterCallback(ntag->isr, ISR_LEVEL_LO, NULL, NULL);
return HAL_ISR_SleepWithTimeout(ntag->isr, timeout_ms);
default:
return NTAG_ERROR_INVALID_PARAM;
}
return 1;
}
My custom function:
uint8_t NTAG_WaitForFDPinState(NTAG_FD_STATE_T state, uint32_t timeout_ms)
{
uint32_t counter = HAL_Timer_getTime_ms();
switch (state)
{
case NTAG_FD_PIN_STATE_HI:
while(rising)
{
if ((HAL_Timer_getTime_ms() - counter > timeout_ms))
{
return 1;
break;
}
}
return 0;
case NTAG_FD_PIN_STATE_LO:
while(falling)
{
if ((HAL_Timer_getTime_ms() - counter > timeout_ms))
{
return 1;
break;
}
}
return 0;
default:
return NTAG_ERROR_INVALID_PARAM;
break;
}
return 1;
}
- rising and falling variables are usually in 1
- when FD rising occurs, rising goes into value 0
- when FD falling occurs, falling goes into value 0
So, I was hoping if someone can explain what does original NTAG_WaitForFDPinState function does because I think I am missing something to make it work.