Input Pins – Low Impedance


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Default Input Pins – Low Impedance

    I have a programme running correctly but the input pins seem to be of low impedance, rather than the high impedance expected.
    Each input current is about 4 mA. The chip is a Pic 16F84 with port A not used and pulled low thru 10 K resistors. Input and output is on port B. Input pins are pulled high with 10K. Under test on the bench a power supply is used to connect to the pin and simulate high and low inputs, and the 4 mA is then measured. However, when used in the application, the signal is from a data acquisition system which can only supply 2.5 mA max.
    I am not able to understand why, from the code attached, a pin seems to work correctly as an input but is not of high-impedance.
    Any help would be much appreciated.
    Regards,
    GraemeJ.
    Code:
                                                                                                                                                                                                      
    ‘pump driver.
    ‘Pic 16F84
    DEFINE OSC 4
    ‘----------[constants and variables]------------
    pump        VAR    PORTB.0        ‘switch pump on/off
    info        VAR    PORTB.1        ‘data being collected
    nsamp        VAR    PORTB.2        ‘new sample required
    autotrig    VAR    PORTB.3        ‘trigger autosampler
    relay        VAR    PORTB.5        ‘pump relay
    sampler    VAR    PORTB.6                ‘goto autosampler position
    led        VAR    PORTB.7        ‘switch on led
    
    ‘----------[initialisation]------------------------
    PORTB    = %00000000            ‘all variable values = 0
    Pause 10
    TRISB        = %11110000        ‘B.0 B.3 inputs, rest outputs.
    Pause 10
    ‘----------[Main]--------------------------------
    begin :        if pump = 0 then pumpoff    ‘hold pump off    
            High    relay            ‘else switch it on
            Pause 5
    datasw :    if info   = 0 then sampsw    ‘if no data flash led
            High    led            ‘else keep led on
            Pause 5
            Goto begin
    Sampsw :    if nsamp = 0 then ledoff    ‘flash led
            Pause 800
            High led
            Pause 800
            Low led
            Pause 5
            Goto begin
    Pumpoff :    Low relay            ‘keep pump off
            Pause 5
            Goto datasw
    Ledoff :    Low led
            Pause 5
            Goto begin
    End
    Attached Files Attached Files
    Last edited by Archangel; - 4th December 2010 at 22:01. Reason: code tags

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,529


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Any chance the powersupply voltage used to simulate the inputs are higher than Vdd of the chip? That might (depending on how much higher it is) forward bias the clamping diode on the input, increasing the current going into the pin.

    /Henrik.

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    TRISB		= %11110000			‘B.0 – B.3 inputs, rest outputs.

    Your TrisB setting is wrong. To have B0 - B3 as inputs then the TrisB should be the other way around

    TrisB = %00001111

    Cheers

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    Code:
    TRISB        = %11110000            ‘B.0 – B.3 inputs, rest outputs.
    Your TrisB setting is wrong. To have B0 - B3 as inputs then the TrisB should be the other way around

    TrisB = %00001111

    Cheers

    Al.
    Al nailed it, the way "I" keep those straight is 0 looks like the letter O for output
    and 1 looks like the uppercase letter I for Input, works for me anyway.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Dec 2010
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Input Pins - Low Impedance

    Thanks everyone. I feel very foolish. My only excuse is that its quite a while since I have been near a uP.
    GraemeJ.

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    NEVER feel foolish about asking a question, for every poster who has the guts to ask there are many who do not and have the same question, so on their behalf, thanks for asking!
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts