Sink Input/Source Output GPIO Pin, Pull up or down?

Discussion in 'General Electronics Chat' started by greggde, Jun 15, 2014.

  1. greggde

    Thread Starter New Member

    Jun 15, 2014
    2
    0
    I am working with the GPIO pins on the Microchip MCP2200 (a specialized PIC18F14K50). There are no internal pull up or pull down resistors for these pins. I'd like my implementation to be generic, that is, for a pins Input/Output mode to be settable at runtime, not design time.

    It seems that I must use a pull up resistor to use a pin as an Input; it floats horribly erratically if I don't pull up or down. However, my Outputs source current, and that same pin used as an Output now has a pull up resistor on it. Other than potentially being seen as "High" by the other end of the Output, is there harm in having a pull up on a sourcing output?

    My boards are set for production this next week, so I'd hate to have to redo the entire board just to provide a means of (manually) disabling the pull ups.

    Thanks for any help.
     
  2. Alberto

    Active Member

    Nov 7, 2008
    169
    36
    When your gpio pin will go low it will drain the pullup current. Since I believe you are using 10k or more for the pullup the current is negligible (unless you have a battery operated device, in such a case you do better remove them)

    Cheers

    Alberto
     
  3. greggde

    Thread Starter New Member

    Jun 15, 2014
    2
    0
    Thanks Alberto,
    So what you are saying is that when I use a pulled up pin as output, setting the pin low will sink the pull up current? That makes sense. What about when I set the output pin high? Do I risk overcurrent? The pull up current should only be .33mA (3V3, 10kOhm resistor), so I'm safe, right? I'm about to risk bricking one of my dev samples by trying the real world experiment :eek: ! Thanks again!
     
  4. Alberto

    Active Member

    Nov 7, 2008
    169
    36
    When you set gpio pin high the pullup resistor will unload your MCU for 0.05% of the current needed by the device connected to the output pin.

    Since the pin high is at the same potential as the pullup no current will flow thruoght the output pin.

    Cheers

    Alberto
     
Loading...