1 `include "lo_read_org.v"
4 pck0 - input main 24Mhz clock (PLL / 4)
5 [7:0] adc_d - input data from A/D converter
6 lo_is_125khz - input freq selector (1=125Khz, 0=136Khz)
8 pwr_lo - output to coil drivers (ssp_clk / 8)
9 adc_clk - output A/D clock signal
10 ssp_frame - output SSS frame indicator (goes high while the 8 bits are shifted)
11 ssp_din - output SSP data to ARM (shifts 8 bit A/D value serially to ARM MSB first)
12 ssp_clk - output SSP clock signal 1Mhz/1.09Mhz (pck0 / 2*(11+lo_is_125khz) )
14 ck_1356meg - input unused
15 ck_1356megb - input unused
16 ssp_dout - input unused
17 cross_hi - input unused
18 cross_lo - input unused
20 pwr_hi - output unused, tied low
21 pwr_oe1 - output unused, undefined
22 pwr_oe2 - output unused, undefined
23 pwr_oe3 - output unused, undefined
24 pwr_oe4 - output unused, undefined
25 dbg - output alias for adc_clk
28 module testbed_lo_read;
51 lo_read_org #(5,10) dut1(
53 .ck_1356meg(ack_1356meg),
54 .ck_1356megb(ack_1356megb),
63 .ssp_frame(assp_frame),
70 .lo_is_125khz(lo_is_125khz)
75 .ck_1356meg(bck_1356meg),
76 .ck_1356megb(bck_1356megb),
85 .ssp_frame(bssp_frame),
92 .lo_is_125khz(lo_is_125khz),
96 integer idx, i, adc_val=8;
99 always #5 pck0 = !pck0;
105 adc_val = (adc_val *2) + 53;
115 divisor=255; //min 19, 95=125Khz, max 255
117 // simulate 4 A/D cycles at 125Khz
118 for (i = 0 ; i < 8 ; i = i + 1) begin