1 //-----------------------------------------------------------------------------
2 // The way that we connect things in low-frequency simulation mode. In this
3 // case just pass everything through to the ARM, which can bit-bang this
4 // (because it is so slow).
6 // Jonathan Westhues, April 2006
7 //-----------------------------------------------------------------------------
10 input pck0, input [7:0] pck_cnt, input pck_divclk,
11 output pwr_lo, output pwr_hi,
12 output pwr_oe1, output pwr_oe2, output pwr_oe3, output pwr_oe4,
13 input [7:0] adc_d, output adc_clk,
14 output ssp_frame, input ssp_dout, output ssp_clk,
20 wire tag_modulation = ssp_dout & !lf_field;
21 wire reader_modulation = !ssp_dout & lf_field & pck_divclk;
23 // No logic, straight through.
24 assign pwr_oe1 = 1'b0; // not used in LF mode
25 assign pwr_oe2 = tag_modulation;
26 assign pwr_oe3 = tag_modulation;
27 assign pwr_oe4 = tag_modulation;
28 assign ssp_clk = cross_lo;
29 assign pwr_lo = reader_modulation;
31 assign dbg = ssp_frame;
33 assign adc_clk = ~pck_divclk;
35 // Toggle the output with hysteresis
36 // Set to high if the ADC value is above 200
37 // Set to low if the ADC value is below 64
42 always @(posedge pck0)
44 if((pck_cnt == 8'd7) && !pck_divclk) begin
45 is_high = (adc_d >= 8'd190);
46 is_low = (adc_d <= 8'd70);
50 always @(posedge is_high or posedge is_low)
58 assign ssp_frame = output_state;