News:

Let's find out together what makes a PIC Tick!

Main Menu

Floating pin emulation in PICs?

Started by trastikata, Dec 22, 2022, 07:54 PM

Previous topic - Next topic

trastikata

Hello all,

I need to set a PIC pin to either High, Low or Floating. And I was thinking that using a GPIO pin as either High-Low Output and Input might not work due to the current being sunk when set as Input.

So I intend to use an ADC pin and switch between digital output high and low and analog ADC input with disconnected S&H capacitor for the floating state, do you think it will work?

Thanks

david

Hi,
Sounds a little dodgy to me - the leakage on the pin in analog mode could be high or low (sourcing or sinking).  If you have a look at the analog input model it shows leakage as +/-500nA which seems to imply the pin could bias either way and would need to be overdriven by an external voltage source applied to the pin.
Maybe I've misunderstood your intended application.

Cheers,
David

Yasin

I hope I understood the question correctly. I have been using the data pins used for GLCD (KS0108) for a long time, also in Keypad (4x4). I added appropriate resistors in the hardware connection to avoid conflicts.

Best regards.

trastikata

Some devices have pins that select the mode of operation based on a three-state logic - High, Low and Floating (open).

The current leakage of the PIC digital input port can be up to +-1uA (which could be problematic) whereas the current leakage for the PIC analog input, when disconnected from the S&H circuit, is limited to +-100nA and I was thinking using it for that reason to set the three-state logic pin.

So I was wondering if you see any potential problems in this set-up that I might be omitting.

david

Hi,
I think you will find the devices that have trinary input options (e.g. early keyless entry encoders) have a weak midpoint bias that is easily overridden by an active high or low input but is still much greater than any leakage current if left floating.  I think you will be fine but may want to check out the data on the device this is being applied to.

Cheers,
David