+ Post New Thread
Results 1 to 5 of 5

24th September 2015, 15:05 #1
 Join Date
 Apr 2015
 Posts
 8
 Helped
 0 / 0
 Points
 191
 Level
 2
N bit Adc vams model
I am modelling a 12 bit ADC in vams.
The input range is 0.3 to 1.5V. i.e 0.3 = 000'H and 1.2V = FFF'H.
Need your help in selecting midpoint values
max= 1.5;
min=0.3
fullscale = maxmin;
midpoint = fullscale/2.0;
This logic doesnt work.

Advertisement

24th September 2015, 15:11 #2
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 45,441
 Helped
 13826 / 13826
 Points
 260,224
 Level
 100
Re: N bit Adc vams model
In case "midpoint" refers to the voltage level between min and max, I suggest
midpoint = (min + max)/2.0, or 0.9 V

Advertisement

25th September 2015, 07:26 #3
 Join Date
 Apr 2015
 Posts
 8
 Helped
 0 / 0
 Points
 191
 Level
 2
Re: N bit Adc vams model
Code:analog begin V(VREF)<+ 0.7 + (TRIM * 0.0266667); max_1=V(VREF) + 0.6; min_1=V(VREF)  0.6; // min_1=0; fullscale_1=max_1+min_1; midpoint1=fullscale_1/2.0; end always@( posedge (CLK_IN) or !(fault_avdd) ) begin //if (!(fault_avdd)) // begin sample1=V(VIN); //sample1=sample1dummy; $display("INSIDE LOOP"); for (i=0;i<`BITS;i=i+1) begin if(sample1 >= midpoint1) begin V_DOUT[`BITS1i]=1; sample1=sample1midpoint1; $display("VALUE OF Sample inside if %f",sample1); $display("VALUE OF MIDPOINT inside if %f",midpoint1); $display("VALUE OF DUMMY %f", dummy); $display("VALUE OF MAX %f", max_1); end else begin V_DOUT[i]=0; $display("VALUE OF Sample inside else %f",sample1); $display("VALUE OF MIDPOINT inside else %f",midpoint1); $display("VALUE OF DUMMY %f", dummy); $display("VALUE OF MAX %f", max_1); end sample1 = 2.0*sample1; end // end if (fault_avdd) begin for (i=0;i<`BITS;i=i+1) begin V_DOUT[i]=0; end end end
VREF keeps on changing based on TRIM bitsLast edited by FvM; 25th September 2015 at 07:44. Reason: Added code tags

Advertisement

25th September 2015, 08:22 #4
Awards:
 Join Date
 Apr 2014
 Posts
 15,763
 Helped
 3590 / 3590
 Points
 77,782
 Level
 68
Re: N bit Adc vams model
Hi,
fullscale_1=max_1+min_1;
midpoint1=fullscale_1/2.0;
The midpoint calculation is correct.
Klaus

25th September 2015, 08:30 #5
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 45,441
 Helped
 13826 / 13826
 Points
 260,224
 Level
 100
Re: N bit Adc vams model
The calculation seems to mix absolute and relative voltage levels, which might cause confusion and unexpected results.
It's difficult to guess the meaning of the code without knowing the related hardware.
+ Post New Thread
Please login