Anıl Özdemirli
Newbie level 3
Hi my name is Anil and i am working on a project that converts analog signals into digital. Referring UG230 (figure 10-4 in page 76 and figure 10-7 in page 78 ) i have written a verilog code in Xilinx ISE 8.1 . After loading the created ".bit" file into the kit, i have applied 1.5V (From the battery) to the "VINA" pin shown in figure 10-2 in page 74. My aim is to monitor 8 most significant bits on the LEDs of the kit. But i cannot see anything on the LEDs after one-time flashing. For those who have an idea about it, please help me to find my error. THANKS...
UCF FILE:
NET "SPI_MOSI" LOC = "T4" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "AMP_CS" LOC = "N7" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "SPI_SCK" LOC = "U16" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 8 ;
NET "AMP_SHDN" LOC = "P7" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "AD_CONV" LOC = "P11" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "SPI_MISO" LOC = "N10" | IOSTANDARD = LVCMOS33 ;
NET "SF_CE0" LOC = "D16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SPI_SS_B" LOC = "U3" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "DAC_CS" LOC = "N8" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 8 ;
NET "FPGA_INIT_B" LOC = "T3" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 4 ;
NET "clk" LOC = "C9" | IOSTANDARD = LVCMOS33 ;
NET "L7" LOC = "F9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L6" LOC = "E9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L5" LOC = "D11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L4" LOC = "C11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L3" LOC = "F11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L2" LOC = "E11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L1" LOC = "E12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L0" LOC = "F12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "sw3" LOC = "N17" | IOSTANDARD = LVTTL | PULLUP ;
VERILOG CODE:
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 14:09:39 05/11/2010
// Design Name:
// Module Name: adc_code
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module adc_code(clk,sw3,SPI_MOSI,AMP_CS,SPI_SCK,AMP_SHDN,AD_CONV,SPI_MISO,SPI_SS_B,
DAC_CS,SF_CE0,FPGA_INIT_B,L7,L6,L5,L4,L3,L2,L1,L0);
input clk,SPI_MISO,sw3;
output SPI_MOSI , AMP_CS , SPI_SCK , AMP_SHDN , AD_CONV , SPI_SS_B,
DAC_CS , SF_CE0 , FPGA_INIT_B , L7 , L6 , L5 , L4 , L3 , L2 , L1 , L0 ;
reg SPI_MOSI , AMP_CS=1'b1 , SPI_SCK=1'b0 , AMP_SHDN , AD_CONV=1'b0 , SPI_SS_B,
DAC_CS , SF_CE0 , FPGA_INIT_B , L7 , L6 , L5 , L4 , L3 , L2 , L1 , L0 ;
reg [7:0] count=8'b0;
reg [7:0] result=8'b0;
always @(posedge clk)
begin
//DISABLING OTHER SPI DEVICES
SPI_SS_B = 1'b1;
DAC_CS = 1'b1;
SF_CE0 = 1'b1;
FPGA_INIT_B = 1'b1;
AMP_SHDN = 1'b0;
//DISABLING COMPLETED
//INCREASING THE COUNTER BY "1" IN EACH 20nanoseconds.
count = count + 1'b1;
case (count[7:0])
// GAIN INITIALIZATION
0: AMP_CS=1'b1;
1: AMP_CS=1'b0;
2: AMP_CS=1'b0;
3: AMP_CS=1'b0;
// SPI_SCK BEGINS TO TOGGLE AFTER 60NANOSECONDS THAT AMP_CS BECOMES LOGIC"0"
4: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
5: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
6: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
// THE DURATION OF BEING LOGIC "1" AND "0" FOR SPI_SCK IS 60NANOSECONDS.
7: SPI_SCK=1'b0;
8: SPI_SCK=1'b0;
9: SPI_SCK=1'b0;
10: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
11: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
12: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
13: SPI_SCK=1'b0;
14: SPI_SCK=1'b0;
15: SPI_SCK=1'b0;
16: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
17: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
18: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
19: SPI_SCK=1'b0;
20: SPI_SCK=1'b0;
21: SPI_SCK=1'b0;
22: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
23: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
24: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
25: SPI_SCK=1'b0;
26: SPI_SCK=1'b0;
27: SPI_SCK=1'b0;
28: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
29: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
30: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
31: SPI_SCK=1'b0;
32: SPI_SCK=1'b0;
33: SPI_SCK=1'b0;
34: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
35: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
36: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
37: SPI_SCK=1'b0;
38: SPI_SCK=1'b0;
39: SPI_SCK=1'b0;
40: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
41: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
42: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
43: SPI_SCK=1'b0;
44: SPI_SCK=1'b0;
45: SPI_SCK=1'b0;
46: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b1; end
47: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b1; end
48: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b1; end
49: SPI_SCK=1'b0;
50: SPI_SCK=1'b0;
51: SPI_SCK=1'b0;
//DURING THE INITIALIZATION THE DATA (00000001) FOR ADJUSTING THE GAIN IS
//SENT VIA "SPI_MOSI" AT THE RISING EDGE OF "SPI_SCK"
52: AMP_CS=1'b1; // AMPLIFER DISABLED
endcase // GAIN INITIALIZATION IS OVER
if(sw3)
begin
case (count[7:0])
53: AD_CONV = 1'b1;
54: begin AD_CONV = 1'b0 ; SPI_SCK = 1'b1;end
55: SPI_SCK = 1'b1;
56: SPI_SCK = 1'b0;
57: SPI_SCK = 1'b0;
58: SPI_SCK = 1'b1;
59: SPI_SCK = 1'b1;
60: SPI_SCK = 1'b0;
61: SPI_SCK = 1'b0; // 2CYCLES OF "SPI_SCK" WITH 40NANOSECONDS PERIOD HAS PASSED
62: SPI_SCK=1'b1 ;
63: begin SPI_SCK=1'b1;result[7]=SPI_MISO;end // DATA IS CATCHED AFTER 20NANOSECODS
// THAT "SPI_SCK" HAS BECOME LOGIC"1".
64: SPI_SCK = 1'b0;
65: SPI_SCK = 1'b0;
66: SPI_SCK=1'b1 ;
67: begin SPI_SCK=1'b1;result[6]=SPI_MISO;end
68: SPI_SCK = 1'b0;
69: SPI_SCK = 1'b0;
70: SPI_SCK=1'b1 ;
71: begin SPI_SCK=1'b1;result[5]=SPI_MISO;end
72: SPI_SCK = 1'b0;
73: SPI_SCK = 1'b0;
74: SPI_SCK=1'b1 ;
75: begin SPI_SCK=1'b1;result[4]=SPI_MISO;end
76: SPI_SCK = 1'b0;
77: SPI_SCK = 1'b0;
78: SPI_SCK=1'b1 ;
79: begin SPI_SCK=1'b1;result[3]=SPI_MISO;end
80: SPI_SCK = 1'b0;
81: SPI_SCK = 1'b0;
82: SPI_SCK=1'b1 ;
83: begin SPI_SCK=1'b1;result[2]=SPI_MISO;end
84: SPI_SCK = 1'b0;
85: SPI_SCK = 1'b0;
86: SPI_SCK=1'b1 ;
87: begin SPI_SCK=1'b1;result[1]=SPI_MISO;end
88: SPI_SCK = 1'b0;
89: SPI_SCK = 1'b0;
90: SPI_SCK=1'b1 ;
91: begin SPI_SCK=1'b1;result[0]=SPI_MISO;end //ONLY 8 MSB IS CAPTURED FOR MONITORING
92: SPI_SCK = 1'b0;
93: SPI_SCK = 1'b0;
94: SPI_SCK=1'b1 ;
95: SPI_SCK=1'b1;
96: SPI_SCK = 1'b0;
97: SPI_SCK = 1'b0;
98: SPI_SCK=1'b1 ;
99: SPI_SCK=1'b1;
100: SPI_SCK = 1'b0;
101: SPI_SCK = 1'b0;
102: SPI_SCK=1'b1 ;
103: SPI_SCK=1'b1;
104: SPI_SCK = 1'b0;
105: SPI_SCK = 1'b0;
106: SPI_SCK=1'b1 ;
107: SPI_SCK=1'b1;
108: SPI_SCK = 1'b0;
109: SPI_SCK = 1'b0;
110: SPI_SCK=1'b1 ;
111: SPI_SCK=1'b1;
112: SPI_SCK = 1'b0;
113: SPI_SCK = 1'b0;
114: SPI_SCK=1'b1 ;
115: SPI_SCK=1'b1;
116: SPI_SCK = 1'b0;
117: SPI_SCK = 1'b0;
// 2 BLANK CYCLE + 14 FOR DATA + 2 FOR FINISHING
// = 18 "SPI_SCK" CYCLE BEGINS FROM CASE "118"
118: begin SPI_SCK = 1'b1 ; {L7,L6,L5,L4,L3,L2,L1,L0}=result[7:0]; end
119: SPI_SCK = 1'b1; // RESULT IS MONITORED AT THE LEDS AT CASE "118"
120: SPI_SCK = 1'b0;
121: SPI_SCK = 1'b0;
122: SPI_SCK = 1'b1;
123: SPI_SCK = 1'b1;
124: SPI_SCK = 1'b0;
125: SPI_SCK = 1'b0;
126: SPI_SCK = 1'b1;
127: SPI_SCK = 1'b1;
128: SPI_SCK = 1'b0;
129: SPI_SCK = 1'b0;
130: SPI_SCK = 1'b1;
131: SPI_SCK = 1'b1;
132: SPI_SCK = 1'b0;
133: SPI_SCK = 1'b0;
134: SPI_SCK = 1'b1;
135: SPI_SCK = 1'b1;
136: SPI_SCK = 1'b0;
137: SPI_SCK = 1'b0;
138: SPI_SCK = 1'b1;
139: SPI_SCK = 1'b1;
140: SPI_SCK = 1'b0;
141: SPI_SCK = 1'b0;
142: SPI_SCK = 1'b1;
143: SPI_SCK = 1'b1;
144: SPI_SCK = 1'b0;
145: SPI_SCK = 1'b0;
146: SPI_SCK = 1'b1;
147: SPI_SCK = 1'b1;
148: SPI_SCK = 1'b0;
149: SPI_SCK = 1'b0;
150: SPI_SCK = 1'b1;
151: SPI_SCK = 1'b1;
152: SPI_SCK = 1'b0;
153: SPI_SCK = 1'b0;
154: SPI_SCK = 1'b1;
155: SPI_SCK = 1'b1;
156: SPI_SCK = 1'b0;
157: SPI_SCK = 1'b0;
158: SPI_SCK = 1'b1;
159: SPI_SCK = 1'b1;
160: SPI_SCK = 1'b0;
161: SPI_SCK = 1'b0;
162: SPI_SCK = 1'b1;
163: SPI_SCK = 1'b1;
164: SPI_SCK = 1'b0;
165: SPI_SCK = 1'b0;
166: SPI_SCK = 1'b1;
167: SPI_SCK = 1'b1;
168: SPI_SCK = 1'b0;
169: SPI_SCK = 1'b0;
170: SPI_SCK = 1'b1;
171: SPI_SCK = 1'b1;
172: SPI_SCK = 1'b0;
173: SPI_SCK = 1'b0;
174: SPI_SCK = 1'b1;
175: SPI_SCK = 1'b1;
176: SPI_SCK = 1'b0;
177: SPI_SCK = 1'b0;
178: SPI_SCK = 1'b1;
179: SPI_SCK = 1'b1;
180: SPI_SCK = 1'b0;
181: SPI_SCK = 1'b0;
182: SPI_SCK = 1'b1;
183: SPI_SCK = 1'b1;
184: SPI_SCK = 1'b0;
185: SPI_SCK = 1'b0;
186: SPI_SCK = 1'b1;
187: SPI_SCK = 1'b1;
188: begin SPI_SCK = 1'b0 ; result[7:0]=8'b0;end // RESULT IS ERASED
189: SPI_SCK = 1'b0 ;
default: count[7:0]=8'b00000000; // RETURNING TO CASE "53"
endcase
end
end
endmodule
UCF FILE:
NET "SPI_MOSI" LOC = "T4" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "AMP_CS" LOC = "N7" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "SPI_SCK" LOC = "U16" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 8 ;
NET "AMP_SHDN" LOC = "P7" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "AD_CONV" LOC = "P11" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "SPI_MISO" LOC = "N10" | IOSTANDARD = LVCMOS33 ;
NET "SF_CE0" LOC = "D16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SPI_SS_B" LOC = "U3" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 6 ;
NET "DAC_CS" LOC = "N8" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 8 ;
NET "FPGA_INIT_B" LOC = "T3" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 4 ;
NET "clk" LOC = "C9" | IOSTANDARD = LVCMOS33 ;
NET "L7" LOC = "F9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L6" LOC = "E9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L5" LOC = "D11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L4" LOC = "C11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L3" LOC = "F11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L2" LOC = "E11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L1" LOC = "E12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "L0" LOC = "F12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "sw3" LOC = "N17" | IOSTANDARD = LVTTL | PULLUP ;
VERILOG CODE:
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 14:09:39 05/11/2010
// Design Name:
// Module Name: adc_code
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module adc_code(clk,sw3,SPI_MOSI,AMP_CS,SPI_SCK,AMP_SHDN,AD_CONV,SPI_MISO,SPI_SS_B,
DAC_CS,SF_CE0,FPGA_INIT_B,L7,L6,L5,L4,L3,L2,L1,L0);
input clk,SPI_MISO,sw3;
output SPI_MOSI , AMP_CS , SPI_SCK , AMP_SHDN , AD_CONV , SPI_SS_B,
DAC_CS , SF_CE0 , FPGA_INIT_B , L7 , L6 , L5 , L4 , L3 , L2 , L1 , L0 ;
reg SPI_MOSI , AMP_CS=1'b1 , SPI_SCK=1'b0 , AMP_SHDN , AD_CONV=1'b0 , SPI_SS_B,
DAC_CS , SF_CE0 , FPGA_INIT_B , L7 , L6 , L5 , L4 , L3 , L2 , L1 , L0 ;
reg [7:0] count=8'b0;
reg [7:0] result=8'b0;
always @(posedge clk)
begin
//DISABLING OTHER SPI DEVICES
SPI_SS_B = 1'b1;
DAC_CS = 1'b1;
SF_CE0 = 1'b1;
FPGA_INIT_B = 1'b1;
AMP_SHDN = 1'b0;
//DISABLING COMPLETED
//INCREASING THE COUNTER BY "1" IN EACH 20nanoseconds.
count = count + 1'b1;
case (count[7:0])
// GAIN INITIALIZATION
0: AMP_CS=1'b1;
1: AMP_CS=1'b0;
2: AMP_CS=1'b0;
3: AMP_CS=1'b0;
// SPI_SCK BEGINS TO TOGGLE AFTER 60NANOSECONDS THAT AMP_CS BECOMES LOGIC"0"
4: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
5: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
6: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
// THE DURATION OF BEING LOGIC "1" AND "0" FOR SPI_SCK IS 60NANOSECONDS.
7: SPI_SCK=1'b0;
8: SPI_SCK=1'b0;
9: SPI_SCK=1'b0;
10: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
11: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
12: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
13: SPI_SCK=1'b0;
14: SPI_SCK=1'b0;
15: SPI_SCK=1'b0;
16: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
17: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
18: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
19: SPI_SCK=1'b0;
20: SPI_SCK=1'b0;
21: SPI_SCK=1'b0;
22: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
23: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
24: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
25: SPI_SCK=1'b0;
26: SPI_SCK=1'b0;
27: SPI_SCK=1'b0;
28: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
29: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
30: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
31: SPI_SCK=1'b0;
32: SPI_SCK=1'b0;
33: SPI_SCK=1'b0;
34: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
35: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
36: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
37: SPI_SCK=1'b0;
38: SPI_SCK=1'b0;
39: SPI_SCK=1'b0;
40: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
41: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
42: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b0; end
43: SPI_SCK=1'b0;
44: SPI_SCK=1'b0;
45: SPI_SCK=1'b0;
46: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b1; end
47: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b1; end
48: begin SPI_SCK = 1'b1 ; SPI_MOSI=1'b1; end
49: SPI_SCK=1'b0;
50: SPI_SCK=1'b0;
51: SPI_SCK=1'b0;
//DURING THE INITIALIZATION THE DATA (00000001) FOR ADJUSTING THE GAIN IS
//SENT VIA "SPI_MOSI" AT THE RISING EDGE OF "SPI_SCK"
52: AMP_CS=1'b1; // AMPLIFER DISABLED
endcase // GAIN INITIALIZATION IS OVER
if(sw3)
begin
case (count[7:0])
53: AD_CONV = 1'b1;
54: begin AD_CONV = 1'b0 ; SPI_SCK = 1'b1;end
55: SPI_SCK = 1'b1;
56: SPI_SCK = 1'b0;
57: SPI_SCK = 1'b0;
58: SPI_SCK = 1'b1;
59: SPI_SCK = 1'b1;
60: SPI_SCK = 1'b0;
61: SPI_SCK = 1'b0; // 2CYCLES OF "SPI_SCK" WITH 40NANOSECONDS PERIOD HAS PASSED
62: SPI_SCK=1'b1 ;
63: begin SPI_SCK=1'b1;result[7]=SPI_MISO;end // DATA IS CATCHED AFTER 20NANOSECODS
// THAT "SPI_SCK" HAS BECOME LOGIC"1".
64: SPI_SCK = 1'b0;
65: SPI_SCK = 1'b0;
66: SPI_SCK=1'b1 ;
67: begin SPI_SCK=1'b1;result[6]=SPI_MISO;end
68: SPI_SCK = 1'b0;
69: SPI_SCK = 1'b0;
70: SPI_SCK=1'b1 ;
71: begin SPI_SCK=1'b1;result[5]=SPI_MISO;end
72: SPI_SCK = 1'b0;
73: SPI_SCK = 1'b0;
74: SPI_SCK=1'b1 ;
75: begin SPI_SCK=1'b1;result[4]=SPI_MISO;end
76: SPI_SCK = 1'b0;
77: SPI_SCK = 1'b0;
78: SPI_SCK=1'b1 ;
79: begin SPI_SCK=1'b1;result[3]=SPI_MISO;end
80: SPI_SCK = 1'b0;
81: SPI_SCK = 1'b0;
82: SPI_SCK=1'b1 ;
83: begin SPI_SCK=1'b1;result[2]=SPI_MISO;end
84: SPI_SCK = 1'b0;
85: SPI_SCK = 1'b0;
86: SPI_SCK=1'b1 ;
87: begin SPI_SCK=1'b1;result[1]=SPI_MISO;end
88: SPI_SCK = 1'b0;
89: SPI_SCK = 1'b0;
90: SPI_SCK=1'b1 ;
91: begin SPI_SCK=1'b1;result[0]=SPI_MISO;end //ONLY 8 MSB IS CAPTURED FOR MONITORING
92: SPI_SCK = 1'b0;
93: SPI_SCK = 1'b0;
94: SPI_SCK=1'b1 ;
95: SPI_SCK=1'b1;
96: SPI_SCK = 1'b0;
97: SPI_SCK = 1'b0;
98: SPI_SCK=1'b1 ;
99: SPI_SCK=1'b1;
100: SPI_SCK = 1'b0;
101: SPI_SCK = 1'b0;
102: SPI_SCK=1'b1 ;
103: SPI_SCK=1'b1;
104: SPI_SCK = 1'b0;
105: SPI_SCK = 1'b0;
106: SPI_SCK=1'b1 ;
107: SPI_SCK=1'b1;
108: SPI_SCK = 1'b0;
109: SPI_SCK = 1'b0;
110: SPI_SCK=1'b1 ;
111: SPI_SCK=1'b1;
112: SPI_SCK = 1'b0;
113: SPI_SCK = 1'b0;
114: SPI_SCK=1'b1 ;
115: SPI_SCK=1'b1;
116: SPI_SCK = 1'b0;
117: SPI_SCK = 1'b0;
// 2 BLANK CYCLE + 14 FOR DATA + 2 FOR FINISHING
// = 18 "SPI_SCK" CYCLE BEGINS FROM CASE "118"
118: begin SPI_SCK = 1'b1 ; {L7,L6,L5,L4,L3,L2,L1,L0}=result[7:0]; end
119: SPI_SCK = 1'b1; // RESULT IS MONITORED AT THE LEDS AT CASE "118"
120: SPI_SCK = 1'b0;
121: SPI_SCK = 1'b0;
122: SPI_SCK = 1'b1;
123: SPI_SCK = 1'b1;
124: SPI_SCK = 1'b0;
125: SPI_SCK = 1'b0;
126: SPI_SCK = 1'b1;
127: SPI_SCK = 1'b1;
128: SPI_SCK = 1'b0;
129: SPI_SCK = 1'b0;
130: SPI_SCK = 1'b1;
131: SPI_SCK = 1'b1;
132: SPI_SCK = 1'b0;
133: SPI_SCK = 1'b0;
134: SPI_SCK = 1'b1;
135: SPI_SCK = 1'b1;
136: SPI_SCK = 1'b0;
137: SPI_SCK = 1'b0;
138: SPI_SCK = 1'b1;
139: SPI_SCK = 1'b1;
140: SPI_SCK = 1'b0;
141: SPI_SCK = 1'b0;
142: SPI_SCK = 1'b1;
143: SPI_SCK = 1'b1;
144: SPI_SCK = 1'b0;
145: SPI_SCK = 1'b0;
146: SPI_SCK = 1'b1;
147: SPI_SCK = 1'b1;
148: SPI_SCK = 1'b0;
149: SPI_SCK = 1'b0;
150: SPI_SCK = 1'b1;
151: SPI_SCK = 1'b1;
152: SPI_SCK = 1'b0;
153: SPI_SCK = 1'b0;
154: SPI_SCK = 1'b1;
155: SPI_SCK = 1'b1;
156: SPI_SCK = 1'b0;
157: SPI_SCK = 1'b0;
158: SPI_SCK = 1'b1;
159: SPI_SCK = 1'b1;
160: SPI_SCK = 1'b0;
161: SPI_SCK = 1'b0;
162: SPI_SCK = 1'b1;
163: SPI_SCK = 1'b1;
164: SPI_SCK = 1'b0;
165: SPI_SCK = 1'b0;
166: SPI_SCK = 1'b1;
167: SPI_SCK = 1'b1;
168: SPI_SCK = 1'b0;
169: SPI_SCK = 1'b0;
170: SPI_SCK = 1'b1;
171: SPI_SCK = 1'b1;
172: SPI_SCK = 1'b0;
173: SPI_SCK = 1'b0;
174: SPI_SCK = 1'b1;
175: SPI_SCK = 1'b1;
176: SPI_SCK = 1'b0;
177: SPI_SCK = 1'b0;
178: SPI_SCK = 1'b1;
179: SPI_SCK = 1'b1;
180: SPI_SCK = 1'b0;
181: SPI_SCK = 1'b0;
182: SPI_SCK = 1'b1;
183: SPI_SCK = 1'b1;
184: SPI_SCK = 1'b0;
185: SPI_SCK = 1'b0;
186: SPI_SCK = 1'b1;
187: SPI_SCK = 1'b1;
188: begin SPI_SCK = 1'b0 ; result[7:0]=8'b0;end // RESULT IS ERASED
189: SPI_SCK = 1'b0 ;
default: count[7:0]=8'b00000000; // RETURNING TO CASE "53"
endcase
end
end
endmodule