adc10_open_unit problem

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

adc10_open_unit problem

Post by vadimrok »

Hello!

I've uncovered some strange behavior of the adc10_open_unit function.
When I disconnect the ADC-12 from the parallel port and call adc10_open_unit(...) from my application I get 1 back which means that the function succeeded (Wrong!). All calls to adc10_get_value() after that return 4095. Does it look normal or it is a bug? I want the user to have an ability to see that device is unplugged if this is the case and correct the problem.
Vadim

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

Post by markspencer »

Hi,

The function adc10_open_unit return value is not an indication of whether the ADC12 is connected, but if the parallel port can be opened. If the unit is not connected the value returned by adc10_get_value will always be 4096 adc counts, since it has a 12 bit resolution.

If the full voltage range is not required then the value of 4096 could be used as a test, thus if the return value is equal to 4096 then you would know that the unit is not connected.

Best Regards,
Regards,

Mark Spencer

Post Reply