From c4e019ec607b604af4ee0224ec171730c93b313f Mon Sep 17 00:00:00 2001 From: rfidgeek1337 Date: Wed, 11 Jun 2025 18:07:51 +0200 Subject: [PATCH 1/4] LF HITAG: Adjust timing for LF ADC measurements to increase stability when the tag is in public mode/TTF mode Signed-off-by: rfidgeek1337 --- armsrc/lfadc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/armsrc/lfadc.c b/armsrc/lfadc.c index 38d6558d8..20efd5c17 100644 --- a/armsrc/lfadc.c +++ b/armsrc/lfadc.c @@ -236,8 +236,13 @@ void lf_init(bool reader, bool simulate, bool ledcontrol) { FpgaSetupSsc(FPGA_MAJOR_MODE_LF_READER); // When in reader mode, give the field a bit of time to settle. - // 313T0 = 313 * 8us = 2504us = 2.5ms Hitag2 tags needs to be fully powered. - SpinDelay(10); + // Optimal timing window for LF ADC measurements to be performed: + // minimum: 313T0 = 313 * 8us = 2504us = 2.50ms - Hitag2 tag internal powerup time + // 280T0 = 280 * 8us = 2240us = 2.24ms - HitagS minimum time before the first command (powerup time) + // maximum: 545T0 = 545 * 8us = 4360us = 4.36ms - Hitag2 command waiting time before it starts transmitting in public mode (if configured so) + // 565T0 = 565 * 8us = 4520us = 4.52ms - HitagS waiting time before entering TTF mode + // Thus (2.50 ms + 4.36 ms) / 2 ~= 3 ms, should be a good timing for both tag models + SpinDelay(3); // Steal this pin from the SSP (SPI communication channel with fpga) and use it to control the modulation AT91C_BASE_PIOA->PIO_PER = GPIO_SSC_DOUT; From 4f682501f1b4448b5e6696d4cc42c0afcb929e9f Mon Sep 17 00:00:00 2001 From: rfidgeek1337 Date: Wed, 11 Jun 2025 18:12:24 +0200 Subject: [PATCH 2/4] Update CHANGELOG.md Signed-off-by: rfidgeek1337 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a14775753..7516dcb50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Added `hf_mfu_ultra.lua` script enables restoring dump to ULTRA/UL-5 tags and clearing previously written ULTRA tags (@mak-42) - Fixed `hf mfu sim` to make persistent the counter increases in the emulator memory (@sup3rgiu) - Fixed `hf mf mad` to correctly display MAD version 2 card publisher sector (@BIOS9) +- Fixed `lf hitag dump` and related commands stability when tag is configured in public mode/TTF mode (@rfidgeek1337) ## [Blue Ice.4.20142][2025-03-25] - Added `des_talk.py` script for easier MIFARE DESFire handling (@trigat) From 2dfb0706fa2ce8943474c063f32ce3db6cf84a33 Mon Sep 17 00:00:00 2001 From: rfidgeek1337 Date: Wed, 11 Jun 2025 18:13:21 +0200 Subject: [PATCH 3/4] Update lfadc.c Signed-off-by: rfidgeek1337 --- armsrc/lfadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/armsrc/lfadc.c b/armsrc/lfadc.c index 20efd5c17..1d989208e 100644 --- a/armsrc/lfadc.c +++ b/armsrc/lfadc.c @@ -240,7 +240,7 @@ void lf_init(bool reader, bool simulate, bool ledcontrol) { // minimum: 313T0 = 313 * 8us = 2504us = 2.50ms - Hitag2 tag internal powerup time // 280T0 = 280 * 8us = 2240us = 2.24ms - HitagS minimum time before the first command (powerup time) // maximum: 545T0 = 545 * 8us = 4360us = 4.36ms - Hitag2 command waiting time before it starts transmitting in public mode (if configured so) - // 565T0 = 565 * 8us = 4520us = 4.52ms - HitagS waiting time before entering TTF mode + // 565T0 = 565 * 8us = 4520us = 4.52ms - HitagS waiting time before entering TTF mode (if configured so) // Thus (2.50 ms + 4.36 ms) / 2 ~= 3 ms, should be a good timing for both tag models SpinDelay(3); From f7f0605207b28f6fe8d59897f0598b08886e6747 Mon Sep 17 00:00:00 2001 From: rfidgeek1337 Date: Wed, 11 Jun 2025 18:14:19 +0200 Subject: [PATCH 4/4] Update lfadc.c Signed-off-by: rfidgeek1337 --- armsrc/lfadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/armsrc/lfadc.c b/armsrc/lfadc.c index 1d989208e..18712a7bb 100644 --- a/armsrc/lfadc.c +++ b/armsrc/lfadc.c @@ -241,7 +241,7 @@ void lf_init(bool reader, bool simulate, bool ledcontrol) { // 280T0 = 280 * 8us = 2240us = 2.24ms - HitagS minimum time before the first command (powerup time) // maximum: 545T0 = 545 * 8us = 4360us = 4.36ms - Hitag2 command waiting time before it starts transmitting in public mode (if configured so) // 565T0 = 565 * 8us = 4520us = 4.52ms - HitagS waiting time before entering TTF mode (if configured so) - // Thus (2.50 ms + 4.36 ms) / 2 ~= 3 ms, should be a good timing for both tag models + // Thus (2.50 ms + 4.36 ms) / 2 ~= 3 ms (rounded down to integer), should be a good timing for both tag models SpinDelay(3); // Steal this pin from the SSP (SPI communication channel with fpga) and use it to control the modulation