1
\$\begingroup\$

I'm trying to assign a 12bit parallel bus to a 12bit register. I've reduced the problem to this literal assignment but as with the previous case, only the first bit is being written to anything when I check the output. I've isolated the problem to this section, I can change the first bit data[0] but nothing else regardless of order.

Obligatory sketchy verilog:

input [11:0] ADC_bus;
...
always @(posedge SPIClock)
begin
 count = count + 1;
 if (count == 32)
 begin
 ADC_data[0] <= 1'b1;
 ADC_data[1] <= 1'b1;
 ADC_data[2] <= 1'b1;
 ADC_data[3] <= 1'b1;
 ADC_data[4] <= 1'b1;
 ADC_data[5] <= 1'b1;
 ADC_data[6] <= 1'b1;
 ADC_data[7] <= 1'b1;
 ADC_data[8] <= 1'b1;
 ADC_data[9] <= 1'b1;
 ADC_data[10] <= 1'b1;
 ADC_data[11] <= 1'b1;
 end
 else if (count == 16)
 ADCss = 1;
 else if (count == 64)
 begin
 count = 0;
 ADCss = 0;
 end
end

Result: ADC_data[11:0] is always 1

asked Dec 7, 2014 at 20:41
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Oops, I had a typo in the top level that caused quartus to not see the wire[11:0] DAC_data; declaration and instead assume it was an implied single bit wire without throwing a warning. Seems like a good failure mode.

answered Dec 7, 2014 at 20:47
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.