// Options for the HF reader, correlating against rx from tag\r
#define FPGA_HF_READER_RX_XCORR_848_KHZ (1<<0)\r
#define FPGA_HF_READER_RX_XCORR_SNOOP (1<<1)\r
+#define FPGA_HF_READER_RX_XCORR_QUARTER_FREQ (1<<2)\r
// Options for the HF simulated tag, how to modulate\r
#define FPGA_HF_SIMULATOR_NO_MODULATION (0<<0)\r
#define FPGA_HF_SIMULATOR_MODULATE_BPSK (1<<0)\r
wire hi_read_rx_xcorr_snoop;\r
assign hi_read_rx_xcorr_snoop = conf_word[1];\r
\r
+// Divide the expected subcarrier frequency for hi_read_rx_xcorr by 4\r
+wire hi_read_rx_xcorr_quarter;\r
+assign hi_read_rx_xcorr_quarter = conf_word[2];\r
+\r
// For the high-frequency simulated tag: what kind of modulation to use.\r
wire [2:0] hi_simulate_mod_type;\r
assign hi_simulate_mod_type = conf_word[2:0];\r
hrxc_ssp_frame, hrxc_ssp_din, ssp_dout, hrxc_ssp_clk,\r
cross_hi, cross_lo,\r
hrxc_dbg,\r
- hi_read_rx_xcorr_848, hi_read_rx_xcorr_snoop\r
+ hi_read_rx_xcorr_848, hi_read_rx_xcorr_snoop, hi_read_rx_xcorr_quarter\r
);\r
\r
hi_simulate hs(\r
ssp_frame, ssp_din, ssp_dout, ssp_clk,\r
cross_hi, cross_lo,\r
dbg,\r
- xcorr_is_848, snoop\r
+ xcorr_is_848, snoop, xcorr_quarter_freq\r
);\r
input pck0, ck_1356meg, ck_1356megb;\r
output pwr_lo, pwr_hi, pwr_oe1, pwr_oe2, pwr_oe3, pwr_oe4;\r
output ssp_frame, ssp_din, ssp_clk;\r
input cross_hi, cross_lo;\r
output dbg;\r
- input xcorr_is_848, snoop;\r
+ input xcorr_is_848, snoop, xcorr_quarter_freq;\r
\r
// Carrier is steady on through this, unless we're snooping.\r
assign pwr_hi = ck_1356megb & (~snoop);\r
always @(posedge ck_1356meg)\r
fc_div_2 = ~fc_div_2;\r
\r
+reg fc_div_4;\r
+always @(posedge fc_div_2)\r
+ fc_div_4 = ~fc_div_4;\r
+\r
+reg fc_div_8;\r
+always @(posedge fc_div_4)\r
+ fc_div_8 = ~fc_div_8;\r
+\r
reg adc_clk;\r
\r
-always @(xcorr_is_848 or fc_div_2 or ck_1356meg)\r
- if(xcorr_is_848)\r
- // The subcarrier frequency is fc/16; we will sample at fc, so that \r
- // means the subcarrier is 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 ...\r
- adc_clk <= ck_1356meg;\r
+always @(xcorr_is_848 or xcorr_quarter_freq or ck_1356meg)\r
+ if(~xcorr_quarter_freq)\r
+ begin\r
+ if(xcorr_is_848)\r
+ // The subcarrier frequency is fc/16; we will sample at fc, so that \r
+ // means the subcarrier is 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 ...\r
+ adc_clk <= ck_1356meg;\r
+ else\r
+ // The subcarrier frequency is fc/32; we will sample at fc/2, and\r
+ // the subcarrier will look identical.\r
+ adc_clk <= fc_div_2;\r
+ end\r
else\r
- // The subcarrier frequency is fc/32; we will sample at fc/2, and\r
- // the subcarrier will look identical.\r
- adc_clk <= fc_div_2;\r
+ begin\r
+ if(xcorr_is_848)\r
+ // The subcarrier frequency is fc/64\r
+ adc_clk <= fc_div_4;\r
+ else\r
+ // The subcarrier frequency is fc/128\r
+ adc_clk <= fc_div_8;\r
+ end\r
\r
// When we're a reader, we just need to do the BPSK demod; but when we're an\r
// eavesdropper, we also need to pick out the commands sent by the reader,\r