1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
19 pck0 - input main 24MHz clock (PLL / 4)
20 [7:0] adc_d - input data from A/D converter
21 lo_is_125khz - input freq selector (1=125kHz, 0=136kHz)
23 pwr_lo - output to coil drivers (ssp_clk / 8)
24 adc_clk - output A/D clock signal
25 ssp_frame - output SSS frame indicator (goes high while the 8 bits are shifted)
26 ssp_din - output SSP data to ARM (shifts 8 bit A/D value serially to ARM MSB first)
27 ssp_clk - output SSP clock signal 1MHz/1.09MHz (pck0 / 2*(11+lo_is_125khz) )
29 ck_1356meg - input unused
30 ck_1356megb - input unused
31 ssp_dout - input unused
32 cross_hi - input unused
33 cross_lo - input unused
35 pwr_hi - output unused, tied low
36 pwr_oe1 - output unused, undefined
37 pwr_oe2 - output unused, undefined
38 pwr_oe3 - output unused, undefined
39 pwr_oe4 - output unused, undefined
40 dbg - output alias for adc_clk
43 module testbed_lo_read
;
68 .
ck_1356meg(ck_1356meg
),
69 .
ck_1356megb(ck_1356megb
),
78 .
ssp_frame(ssp_frame
),
85 .
lo_is_125khz(lo_is_125khz
),
89 integer idx
, i
, adc_val
=8;
92 always #5 pck0
= !pck0
;
98 adc_val
= (adc_val
*2) + 53;
109 divisor
= 255; //min 16, 95=125kHz, max 255
111 // simulate 4 A/D cycles at 125kHz
112 for (i
= 0 ; i
< 8 ; i
= i
+ 1) begin