]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Added hitune command for continuously measuring HF antenna tuning
authordaniel.boteanu <daniel.boteanu@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 9 Jan 2010 14:59:42 +0000 (14:59 +0000)
committerdaniel.boteanu <daniel.boteanu@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 9 Jan 2010 14:59:42 +0000 (14:59 +0000)
armsrc/appmain.c
client/command.c
client/prox.h
include/usb_cmd.h

index 237159c94b4691eab97bc662af5fb6efdfb5ecad..6edf138bdfe9b963b71310dd6ace8fd382f35feb 100644 (file)
@@ -202,6 +202,27 @@ void MeasureAntennaTuning(void)
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
 }\r
 \r
+void MeasureAntennaTuningHf(void)\r
+{\r
+       int vHf = 0;    // in mV\r
+\r
+       DbpString("Measuring HF antenna characteristics, press button to exit");\r
+\r
+       for (;;) {\r
+               // Let the FPGA drive the high-frequency antenna around 13.56 MHz.\r
+               FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_READER_RX_XCORR);\r
+               SpinDelay(20);\r
+               // Vref = 3300mV, and an 10:1 voltage divider on the input\r
+               // can measure voltages up to 33000 mV\r
+               vHf = (33000 * AvgAdc(ADC_CHAN_HF)) >> 10;\r
+       \r
+               Dbprintf("%d mV",vHf);\r
+               if (BUTTON_PRESS()) break;\r
+       }\r
+       DbpString("cancelled");\r
+}\r
+\r
+\r
 void SimulateTagHfListen(void)\r
 {\r
        BYTE *dest = (BYTE *)BigBuf;\r
@@ -643,6 +664,10 @@ void UsbPacketReceived(BYTE *packet, int len)
                        MeasureAntennaTuning();\r
                        break;\r
 \r
+               case CMD_MEASURE_ANTENNA_TUNING_HF:\r
+                       MeasureAntennaTuningHf();\r
+                       break;\r
+\r
                case CMD_LISTEN_READER_FIELD:\r
                        ListenReaderField(c->arg[0]);\r
                        break;\r
index 9bfb18f24a349a449dce842122ff5259c801960d..5d27870e14d2f1198e841e4877009fe4630a802f 100644 (file)
@@ -93,6 +93,12 @@ static void CmdTune(char *str)
        SendCommand(&c);\r
 }\r
 \r
+static void CmdHiTune(char *str)\r
+{\r
+       UsbCommand c={CMD_MEASURE_ANTENNA_TUNING_HF};\r
+       SendCommand(&c);\r
+}\r
+\r
 static void CmdHi15read(char *str)\r
 {\r
        UsbCommand c={CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693};\r
@@ -2825,6 +2831,7 @@ static struct {
 /* low-level hardware control */\r
        {"fpgaoff",                     CmdFPGAOff,                     0, "Set FPGA off"},\r
        {"tune",                        CmdTune,                        0, "Measure antenna tuning"},\r
+       {"hitune",                      CmdHiTune,                      0, "Continuously measure HF antenna tuning"},\r
        {"readmem",                     CmdReadmem,                     0, "[address] -- Read memory at decimal address from flash"},\r
        {"reset",                       CmdReset,                       0, "Reset the Proxmark3"},\r
        {"setlfdivisor",        CmdSetDivisor,          0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"},\r
index 10429dc1dbdf8d11729e586b6b38a51b0e5ee8b6..4742ba9a6c68a65960ed1730aff8327bfc1d02eb 100644 (file)
@@ -44,6 +44,7 @@ int GetClock(char *str, int peak);
 static void CmdHIDdemodFSK(char *str);\r
 static void Cmdmanchestermod(char *str);\r
 static void CmdTune(char *str);\r
+static void CmdHiTune(char *str);\r
 static void CmdHi15read(char *str);\r
 static void CmdHi14read(char *str);\r
 static void CmdSri512read(char *str);\r
index 9e2acf6ecea66b8825884ad6274c70003eae3c02..71f0221c2a57a82a39ee5cec7e4b59e3483c1715 100644 (file)
@@ -84,8 +84,9 @@ typedef struct {
 \r
 // For measurements of the antenna tuning\r
 #define CMD_MEASURE_ANTENNA_TUNING                     0x0400\r
-#define CMD_MEASURED_ANTENNA_TUNING                    0x0401\r
-#define CMD_LISTEN_READER_FIELD                                0x0402\r
+#define CMD_MEASURE_ANTENNA_TUNING_HF                  0x0401\r
+#define CMD_MEASURED_ANTENNA_TUNING                    0x0410\r
+#define CMD_LISTEN_READER_FIELD                                0x0420\r
 \r
 // For direct FPGA control\r
 #define CMD_FPGA_MAJOR_MODE_OFF                                0x0500\r
Impressum, Datenschutz