Successive approximation ADC

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Hi,

I am doing an HND in instrumentation and control engineering, I have the following question to which I can find nothing in my teaching material even relating to it!! I have searched online and read a bit about SAR ADCs but cannot find how to do this...

The full range of a 12bit, successive approximation ADC is 1Volt. Determine:

A) the maximum input change to give a one bit change in the output of the ADC

My attempt:

Bit values
bit 0 = 2.500000
bit 1 = 1.250000
bit 2 = 0.625000
bit 3 = 0.315000
bit 4 = 0.156250
bit 5 = 0.781250
bit 6 = 0.0390625
bit 7 = 0.01953125
bit 8 = 0.009765625
bit 9 = 0.0488281250
bit 10 = 0.002411406250
bit 11 = 0.001220703125

as the range is 1 volt, the answer is 0.001220703125 Volt?!

B) the number of approximations required to to complete the conversion of an input signal of 0.8125V and the final binary result of the conversion process.

not sure how to do this!

any help would be appreciated!! Thanks
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Hello
The resolution of the A/D is the reference voltage (1V) divided by 2 raised to the power of the number of bits. In this case it 2^12 = 4096. I believe the SAR takes as many approximations as there are bits to perform a conversion. So a 12 bit won't be as fast as say an 8 bit but it will have a greater resolution.
Adam
 

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Hello
reference voltage (1V) divided by 2 raised to the power of the number of bits. In this case it 2^12 = 4096.
Adam

hi

thanks for the reply. If the reference voltage is 1V, divided by 2 is 0.5. so would it be 0.5^12? This returns a number I wouldn't associate with digital electronics though.

I have found stuff online saying that you check in input voltage against the Vdac.

So if Vin is greater than Vdac then bit 0 is 1, then the Vdac changes... 12 references are taken as a higher/lower until the voltage level is detected. What I cannot find is how the Vdac changes, some examples seem to halve it, whilst some go to 3/4 of the original value of Vdac.

Thanks
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
No it's divided by (2^12) or 4096. I should have made it clearer.
Adam
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
hi

thanks for the reply. If the reference voltage is 1V, divided by 2 is 0.5. so would it be 0.5^12? This returns a number I wouldn't associate with digital electronics though.

I have found stuff online saying that you check in input voltage against the Vdac.

So if Vin is greater than Vdac then bit 0 is 1, then the Vdac changes... 12 references are taken as a higher/lower until the voltage level is detected. What I cannot find is how the Vdac changes, some examples seem to halve it, whilst some go to 3/4 of the original value of Vdac.

Thanks

If Vin is greater than half Vref (1 Volt) then MSB is set. This is then subtracted from the input voltage and the value checked again to see if it's higher than a quarter of the reference voltage. It then carries on until all the bits have been checked.
Adam
 

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
If Vin is greater than half Vref (1 Volt) then MSB is set. This is then subtracted from the input voltage and the value checked again to see if it's higher than a quarter of the reference voltage. It then carries on until all the bits have been checked.
Adam

So.... for 0.4V for example
MSB = Vin (0.4V) is less than half Vref so MSB is 0.
bit 1 = Vin is greater than 1/4 Vref so bit 1 is 1
bit 2 = this is where I get lost....


thanks
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
It's 12 bit so the next bit down is the 11th bit not bit 1. If it makes it easier start from 0 --------> 11. Every time you set a bit starting from zero it increments 244 uV.
 

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Every time you set a bit starting from zero it increments 244 uV.

I don't understand that statement. I guess it is 244uV from 1/4096. But I don't understand what you mean by then... everytime you set a bit starting from zero.

I really appreciate you taking the time to help me but... you need to appreciate I know nothing about these ADCs except what I have read online in the last couple of days so I am struggling quite a bit to understand what you mean.

thanks again.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Maybe I should reword it. Every time the register is incremented it adds 244 uV. Let me do a drawing....Hold on a mo.
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
"If the reference voltage is 1V, divided by 2 is 0.5. so would it be 0.5^12? This returns a number I wouldn't associate with digital electronics though. "

About terminology:
What you call bit0 is called MSB(most significant bit).
What you call bit11 is called LSB(least significant bit).
Normally they go the other way around the larger value bit is the MSB(reverse of what you used).

You need to understand that the digital output is a full length number of digits(N-bits long).
Each bit has it's weighted value as you calculated in post #1
i.e. A single bit by itself has no meaning.

"So if Vin is greater than Vdac then bit 0 is 1, then the Vdac changes... 12 references are taken as a higher/lower until the voltage level is detected. What I cannot find is how the Vdac changes, some examples seem to halve it, whilst some go to 3/4 of the original value of Vdac."

VDAC is changed by logic circuit and a comparator in a step- wise manner,starting from the MSB .

In each step a single bit in the SAR(a register that holds the result) is tested,
the test's result determines the final value of that bit.
Once the bit's value is determined it is not changed anymore during the conversion process !

The first step is always compare against the value of 1/2 never 3/4 !

Here is a simplified(and not entirely accurate) video that can be of help(a 4 bits example).

P.S
You may be familiar with the "Finding a lion in the Deseret " algorithm , AKA Binary search.
It's basically the same thing.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
AD.PNG

I think that's right. Does it make sense?

Edit: To be correct it's (2^12) -1 = 1/4095 = 244.200 uV and not 1/4096 = 244.140 uV

Adam
 
Last edited:

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Ok , so I think it makes more sense now.

so the first comparison is against 1/2 of the reference voltage. The second comparison halves the first comparison (Effectively 1/4 of the reference voltage). The third comparison halves the second comparison (effectively 1/8 of the reference voltage) and so on.... is that correct? You keep halving the previous reference size to narrow down the area which your voltage lies within.

So it would be

Bit 11 = 1/2
bit 10 = 1/4
bit 9 = 1/8
bit 8 =1/16
bit 7 = 1/32
bit 6 = 1/64
an so on....
each time checking if the input voltage is higher or lower than the middle of the reference voltage. So if the input at bit 11 was higher than half, bit 11 = 1. Then by the time you get to bit 7 you are looking in the second half of the range (0.5V - 1V), in a portion that is 1/32 of the entire range.

So if like my question asks, what is the binary output for 0.8125V it would be..... 110011111111

Is that correct?
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
"so the first comparison is against 1/2 of the reference voltage. The second comparison halves the first comparison (Effectively 1/4 of the reference voltage). The third comparison halves the second comparison (effectively 1/8 of the reference voltage) and so on.... is that correct? You keep halving the previous reference size to narrow down the area which your voltage lies within."

Basically yes,
With a small but very important change:
you always add to the previous result!
sar.JPG
"So if like my question asks, what is the binary output for 0.8125V it would be..... 110011111111
Is that correct?"

This is a trick question because we didn't define what happens if the comparison is exactly equal (the same value).

The result 11010000000
is yielding the exact value of 0.8125V

So I guess a more accurate comparison should be done to be either >= or <
 
Last edited:

hevans1944

Hop - AC8NS
Jun 21, 2012
4,968
Joined
Jun 21, 2012
Messages
4,968
Each bit in the digital result has a different voltage "weight" that is the reference voltage divided by the maximum value of the output multiplied by 2^N where N is the bit position. So, for a 12-bit A/D, N = 0, 1, 2, … 11. A 12-bit A/D with a full-scale input of 1.000 volts should result in an output of all ones, or 1111 1111 1111 = 0xFFF = 4095. The least significant bit, bit 0, will have a weight of 1.000 / 4095 = 244.2 μV. The next least significant bit, bit 1, will have a weight of 2 x 244.2 μV = 488.4 μV. Bit 2 will have a weight of 976.8 μV. And so on, the weight doubling for each additional bit until bit 11, which has a weight of 2^11 x 244.2 μV = 2048 x 244.2 μV = 0.5001 V.


A SAR A/D tests the output of a DAC against the analog input that is to be converted into a digital word, starting with the most significant bit set and all other bits cleared. So, for this 12-bit A/D bit 11 is set to produce a DAC output of 0.5001 V. If the analog input is more than that, the bit remains set in the SAR. If it is lower, the bit is cleared. Then the next lower significant bit, bit 10, is set in the SAR that is driving the DAC, and the analog input is tested against this new output of the DAC. As before, if the analog input is more than the DAC output, the bit remains set, and if it is lower the bit is cleared. This procedure is repeated for successively lower bit-positions until setting a bit in the SAR results in the DAC output being more than the analog input.


Since all the lower bit positions have weights that sum to a value less than the bit just set and tested, no combination of those lesser significant bits can also produce a DAC output greater than the input, and therefore those bits do not need to be tested. The current value in the SAR is the correct A/D conversion, to within an accuracy of one least significant bit, so no further lesser significant bits need to be set or cleared.


Clearly the SAR A/D requires that the analog input be stable between successive approximations. This means you must use a low-drift sample-and-hold circuit ahead of the SAR A/D.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Ok , so I think it makes more sense now.

so the first comparison is against 1/2 of the reference voltage. The second comparison halves the first comparison (Effectively 1/4 of the reference voltage). The third comparison halves the second comparison (effectively 1/8 of the reference voltage) and so on.... is that correct? You keep halving the previous reference size to narrow down the area which your voltage lies within.

So it would be

Bit 11 = 1/2
bit 10 = 1/4
bit 9 = 1/8
bit 8 =1/16
bit 7 = 1/32
bit 6 = 1/64
an so on....
each time checking if the input voltage is higher or lower than the middle of the reference voltage. So if the input at bit 11 was higher than half, bit 11 = 1. Then by the time you get to bit 7 you are looking in the second half of the range (0.5V - 1V), in a portion that is 1/32 of the entire range.

So if like my question asks, what is the binary output for 0.8125V it would be..... 110011111111

Is that correct?

Yes that is correct.
Adam
 

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Hi all,

thanks a lot for all the help. It makes much more sense now and I have been able to answer the question :)

I have one more question though, the question is phrased as such:

"How many approximations are made to complete the conversion of an input signal of 0.8125V and the final binary result of the calculation.

Now the value is determined after 4 approximations as the final binary value is 1101 0000 0000. However, I suspect that the ADC would actually make 12 approximations, but the remaining 8 zeros would all be set to 1, compared, and then set back to 0. So although the value is determined in 4 approximations, the ADC would try to get a more accurate approximation using the remaining 8 bits. So it would actually make 12 approximations every time. Is this correct?

Thanks,
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
Yes,
It is correct for all SA A/Ds ,
they always perform all the steps to get a result.
i.e the number of bits,in this case 12 approximations.

Note:
In real life, there is no such thing as a 0.8125 signal exactly.
It could be for example say 0.8124999 or 0.8125001

Even if you do get the signal exactly accurate (theoretically).
The A/D has it's internal reference,comparator and D/A internal errors and there is the effect of noise(various types and causes).
So comparing the exact on the "bit" input will produce a result with a 1 LSB error .

In practice, you can thus get one of the 2 results:
1101 0000 0000 ,1100 1111 1111.
 
Top