Thursday, March 10, 2011

System revision

Development boards usally have many version. Because no board can be perfect first time. So in the process of improving the boards we end up in many system revisions. One way of doing this is to dedicate few gpio lines(may be 3 in this case you can have 2^3 = 8 board versions). Disadvantage of this way is thay you will end up waisting 3 gpios. Another way is to use the ADC for this purpose. The mechanism is to connect two resitance in series and varry the resistance amoung the boards. Measure the voltage across one resitor and find out the board.
For example, R1 = 100K and R2 = 100K. R1 and R2 are in series with volatge of 3.3V. So the voltage drop across R2 will be 1.65V, which we measured using ADC and decision is made.

In C110 processor we use ADC with resolution of 12 bits so the range is 0 to 4095. But the voltage range is 0 to 3.3V. Now we need to map adc value to our voltage range.

Here is the mathematics,
3.3V = 4095 units of ADC
1 unit of ADC = 3300 mV/4095 = 0.8058mv
for 3.3 v adc value is 4095 units( ie 3300/0.8058)

So in our case we need 1.65V or 1650 mV. So the adc value should read 2047(ie 1650/0.8058)

No comments: