## 10 bit vs 12 bit ADC

The question comes up from time to time regarding the pros and cons of the 10 and 12 bit ADC on the MicroStar. This article provides some background information to help you understand the issues.

The 10bit and 12bit refers to the resolution of the ADC integrated into the PIC. The PIC is the microcontroller that is the brain of the Encoder. The ADC (Analog to Digital Converter) is used to convert an analog value (from the joysticks) into a digital value used by the PIC to calculate the servo position. The pots used on the joysticks act as position sensors. The pots have a dc voltage applied across them and the wiper provides a voltage that is a function of the joystick's position. The ADC reads this value.

A 10bit ADC can read a range of values from 0 to 1023 (resolution of 1024) and a 12bit ADC can read 0 to 4095 (resolution of 4096). This is assuming the ADC is unipolar and that is the case in this application. The other important thing to remember is the ADC has a reference voltage that is used in the voltage conversion. If the reference is set at 5 volts and you apply 2.5 volts into the ADC input then you will get 511 with a 10bit ADC and 2047 with a 12bit ADC.

In the case of using pots to measure the joystick position we have a challenge in that the joystick only moves about 60 degrees and pots have a range of around 300 degrees. This means we only use about 20% of the pots range. If you place 10 volts across the pot you will get a range of 0 to 2 volts on the pot's wiper. This is the value you want to measure with the ADC. So, to get full range of the ADC you would set the reference to the max voltage of 2 volts and you can use the full range of the ADC. The trouble is the ADC will not allow a voltage that low for the reference, the lower limit is around 3 volts. This means you do not get the full ADC range. In this example with a 10bit ADC you will get a range of 0 to 682 and with a 12bit ADC you will get a range of 0 to 2730. Every case is a little different depending on the pot shaft rotation range, the range of motion of the joysticks, actual battery voltage (higher battery voltage helps), etc.

So my recommendation depends on a number of issues:

1.) If you are supplying a low voltage to the pots, less than 10 volts, and the pot range is large, more that 270 degrees then I would consider using a 12bit ADC.

2.) Before making the decision I would perform the above analysis and if the range is over about 700 with a 10bit ADC then you are fine, in my opinion.

3.) My personal feeling is you will not be able to tell the difference is you have a range of at least 500 to 700.

The bottom line is it will work in either case; this serves as a resolution limit to the system. There is no harm in using a 12bit ADC so you can always take this option if you are concerned. But keep in mind that using a 12bit ADC does not mean you have a system with 4096 resolution. In the example above the 12bit ADC gave a range of 0 to 2730. This alone does not define the system resolution. The encoder calculates the servo position information to 0.5 uS. Given the servo range is defined by a pulse with that varies from 1 to 2 mS this is a resolution of 1 part in 2000 or about 11 bits. So the best the system resolution can be for this range of servo motion is 2000. The servos can be driven past this range by a little bit so you can actually get a bit more total resolution.