Measuring PIC high-impedance state

Discussion in 'Embedded Systems and Microcontrollers' started by Vaughanabe13, Jun 28, 2010.

  1. Vaughanabe13

    Thread Starter Active Member

    May 4, 2009
    I couldn't find any info in the datasheet for my PIC18F4550 on the rated impedance when an I/O pin is in the high-impedance input state. Is it 1M, 10M, higher? I don't know. I could only find info on the max leakage current in high-impedance (1 uA). Basically I'm trying to connect an RC charge circuit to a high-impedance analog input so I can continually monitor the voltage across the capacitor. But when I charge up the cap and connect it to pin RA0, the voltage is very quickly discharged through RA0. If I make another digital I/O pin high-impedance, and touch my capacitor to that pin, it does not discharge. So something weird is happening with the analog pin. I have ADCON1 set to 0, and all analog pin TRIS bits sit, so they should be in a high impedance analog state.

    *ugh* I finally figured out what was wrong. It wasn't a software issue at all, there was actually a ground wire underneath the board on my bench that was touching a wire connected to RA0 and it was causing the pin to go low, which is why RA0 would discharge my cap and no other pin would. Curses! If there are any mods here you can delete this.
    Last edited: Jun 28, 2010