Recognize adc input disconnected

General discussion on mikroC.
Post Reply
Author
Message
maverick
Posts: 18
Joined: 22 Sep 2011 11:26

Recognize adc input disconnected

#1 Post by maverick » 19 Mar 2012 22:36

Hi, I would like to know if there is any way to recognize whether an input of the ADC software is connected or disconnected.
I use a PIC 18F4550.

In my projecy I use 5 inputs of adc with 5 different potentiometer. In my program, I do a reading of these 5 inputs ports with a loop, but I would make sure that on the reset of the micro, a check routine is performed to detect which are the inputs disconnected (without potentiometer).
In this way, I not read on that input to save time and don't get strange values because there are capture interference from disconnected inputs. :D

Many thanks and sorry for my bad english :(

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Recognize adc input disconnected

#2 Post by janko.kaljevic » 20 Mar 2012 11:35

Hello,

If the pin is configured as analog input and there is nothing connected to it, you will not be able to detect it.
For this purpose you might try to use some other method.

Maybe you should use some other pins for detecting presence of your devices.

Best regards.

Post Reply

Return to “mikroC General”