ADC42 and Testpoint

Post general discussions on using our drivers to write your own software here
Post Reply
pontiga

ADC42 and Testpoint

Post by pontiga »

I am trying to use ADC-42 with Testpoint software. Therefore, I have followed carefully the instructions given in the example

http://www.picotech.com/testpoint.html

To addapt that example (which was written for ADC-40) I have changed the call to open the unit to

"call adc10_open_unit with 1, 42"

However, I miss in the example the formula corresponding to the settings of the math object "adc->volt". I have therefore set "adc->volt" simply as "x". Unfortunately, this does not work, since I always get wrong readings of the voltage. For example, when I apply 0 volts, testpoint reads 2050. When I apply 1.456 volts (LR03 battery), testpoint reads 2661.

Any help? Thanks in advance.

Francisco Pontiga

User avatar
markspencer
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Post by markspencer »

Hi,

I am sorry to hear that you are experiencing this problem.

Believe it or not but the answers that you are getting are correct, but they are being displayed in ADC counts. The ADC-42 is a 12 bit bipolar unit that measues up to 5 volts on both rail. To convert the ADC counts to a voltage reading you will need to insert the following:
Formula

v = (5 * (x - 2048)) / (4096 - 2048)

v : Voltage
x : ADC count
0 Volts : 2048 ADC counts
-5 Volts : 0 ADC counts
+5 Volts : 4095 ADC counts
Best regards,
Regards,

Mark Spencer

Post Reply