adc10_open_unit problem

 
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
Author Message
vadimrok
Guest





PostPosted: Tue May 06, 2003 6:12 pm    Post subject: adc10_open_unit problem Reply with quote

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
Back to top
markspencer
Site Admin
Site Admin


Joined: 07 May 2003
Posts: 610

PostPosted: Thu May 08, 2003 3:23 pm    Post subject: Reply with quote

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,
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
All times are GMT
Page 1 of 1

 


Pico Technology topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group