Input question from a newbe


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    I have been using the resistor approach and sensing the voltage when the LED is off and then that drops close to zero when the LED is illuminated.

    There are 6 LEDs in play and 5 out of the 6 work flawlessly but I'm having problems with one and it is driving me crazy.

    Intermittently the PIC reads the input as positive even when the LED is illuminated just on that one LED. Further information to set the scene:
    This circuit is in a car
    When the engine isn't running it appears much more reliable (suggesting perhaps noise or voltage related)
    With the engine running, turning on the courtesy light will sometimes correct the reading (falsely reading until the courtesy light is turned on and then it reads correctly). This again suggested voltage but turning on something else like the headlights does not have the same effect.

    I've tried varying the resistor value and putting in capacitors but has no effect.

    Anybody have any ideas? I'm pulling my hair out here.

  2. #2
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    To make matters worse (or maybe help diagnose) I went back to one of my earlier boards and it works perfectly..

    On the newer boards (I have 3 that are all doing the same) that are having the problem, touching the resistor on the side before it enters the PIC makes it work. Is it the capacitance in my finger that is causing it to work?

    The layout of the boards (old to new) is virtually identical, I moved a couple of components a little to make the board a little smaller (we are only talking 1/8-1/4 of an inch). The components are all the same values but some are different manufactures, but really clutching at straws at that point. I don't have a scope handy (although I will have access to one on Wednesday) so cant really see what is going on.

  3. #3
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    What PIC are you using? Also what specific pin are you using?
    Shawn

  4. #4
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by spcw1234 View Post
    What PIC are you using? Also what specific pin are you using?
    16F877a and RB4

  5. #5
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Nothing specific to that pin that should cause an issue. Have you measured voltage at that pin? It sounds like it is floating, possibly due to a broken trace or a bad connection.
    Shawn

  6. #6
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by spcw1234 View Post
    Nothing specific to that pin that should cause an issue. Have you measured voltage at that pin? It sounds like it is floating, possibly due to a broken trace or a bad connection.
    When measuring the voltage at the pin with the LED illuminated the presence of the meter causes the input to behave as expected and the voltage is around 300-400mv. With the LED off the voltage is ~5.4V. I have three boards that are all exhibiting the same problem so don't think it is broken trace or bad connection.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    If you haven't disabled LVP mode, it may acts funny. It may also act funny if you
    - haven't connect ALL Vss AND Vdd pins.
    - have left MCLR pin floating
    - haven't properly set all ADC register properly
    - have a noisy PSU, lacking of decoupling cap
    - etc
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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