+
+/*
+ * Sweeps the useful LF range of the proxmark from
+ * 46.8kHz (divisor=255) to 600kHz (divisor=19) and
+ * reads the voltage in the antenna: the result is a graph
+ * which should clearly show the resonating frequency of your
+ * LF antenna ( hopefully around 90 if it is tuned to 125kHz!)
+ */\r
+void SweepLFrange()\r
+{\r
+ BYTE *dest = (BYTE *)BigBuf;\r
+ int i;\r
+\r
+ // clear buffer\r
+ memset(BigBuf,0,sizeof(BigBuf));\r
+\r
+ FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_READER);\r
+ for (i=255; i>19; i--) {\r
+ FpgaSendCommand(FPGA_CMD_SET_DIVISOR, i);\r
+ SpinDelay(20);\r
+ dest[i] = (137500 * AvgAdc(4)) >> 18;\r
+ }\r
+}\r