Altera_Forum
Honored Contributor
9 years agoADC 0804 in FPGA DE2-70
Hello there team Altera,
I have a project regarding the implementation of ADC 0804 in FPGA DE2-70, I have very bad super vision and am really weak in coding as well and all am looking for is the coding for is the Quartus II simulation with the ModelSim test bench. I have tried this coding but am not sure how to make it fit plus its missing the ModelSim test bench. taken from the attached paper. else begin data_in[13] = data_in[11] ; // shift register to accumulate // data bits data_in[11] = data_in[9] ; data_in[9] = data_in[7] ; data_in[7] = data_in[5] ; data_in[5] = data_in[3] ; data_in[3] = data_in[1] ; data_in[1] = data_sd0 ; // add new data bit into shift // register end end // Shift register to capture the serial data from data_sd0 port on negative edge always @(negedge outclk or posedge rst) begin if (rst) begin data_in[12] = 1'b0 ; data_in[10] = 1'b0 ; data_in[8] = 1'b0 ; data_in[6] = 1'b0 ; data_in[4] = 1'b0 ; data_in[2] = 1'b0 ; data_in[0] = 1'b0 ; end else begin data_in[12] = data_in[10] ; // shift register to accumulate // data bits data_in[10] = data_in[8] ; data_in[8] = data_in[6] ; data_in[6] = data_in[4] ; data_in[4] = data_in[2] ; data_in[2] = data_in[0] ; data_in[0] = data_sd0 ; // add new data bit into shift // register end end // data capture at frame signal always @(posedge frame or posedge rst) begin if (rst) begin datareg0 = 14'b00000000000000 ; wr_addr = 9'b000000000 ; // initialize the memory write address // counter wr_enable = 1'b1 ; // initialize the memory write enable // signal end else begin datareg0 = data_in ; // add new word of data into data register if (wr_enable) wr_addr = wr_addr + 1 ; // increment the address counter else wr_addr = wr_addr ; // hold the address counter at this value if (wr_addr[9]) wr_enable = 1'b0 ; // disable write enable when address MSB = 1 // to prevent overwriting data in memory else wr_enable = 1'b1 ; end end endmodule If you can help in any kind of way please let me know am hopeless and you're my only hope. thank you.