Input question from a newbe


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    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

  2. #2
    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.

  3. #3
    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.

  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 mister_e View Post
    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
    LVP mode is disabled.

    - ALL Vss AND Vdd pins are connected
    - MCLR pin isn't floating
    - Believe ADC register properly set
    - Using 7805 and capacitors which are the same on the board that works and the ones that don't

    The other discovery is it appears to be more to do with that particular LED in the circuit I'm monitoring. As I mentioned, I'm monitoring 6 LEDs and 5 are working perfectly. If I swap the pin being used to monitor the problem LED the unreliability follows the LED. So swapping RB4 and RB3 the problem moves to RB3 and the LED then being monitored by RB4 works flawlessly.

    The strange thing is with an identical circuit the monitor of all 6 is fine (the components are all the same values but from different supplier). It looks like I must be on the edge of some tolerances or something and going to wait until I have access to a scope on Wednesday to see if that helps me see what is going on.

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Looks like you're on to something with the tolerances.

    How about comparing datasheets between manufacturers in the meantime? It would serve as a good exercise.

    Robert

  6. #6
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Now I really am going mad or just confused...

    By playing with components I got the circuit to work until I put it everything back together and it then stopped working reliably. Then I noticed something very strange, in my workshop it worked more reliably with the lights on! Which was the difference between the old boards that worked and the new ones that didn't, the new ones were in boxes!!! I initially thought noise or perhaps moving wires with bad connections etc. But no, I can have the circuit not working with lights out and then turn the lights on from the other side of the room and hey presto....

    That would also explain why it worked with the courtesy light on!!! Are zener diodes light sensitive?

    Any thoughts on how I can make this reliable without being sensitive to light!

    To remind every what I'm doing:
    I'm monitoring LEDs that are switch on by the car switching to ground (they are permanently fed with +12V accessory circuit). Monitoring the point after the LED which is grounded by the car it is ~12V when LED is off and then ~1V when on. Going through a fairly large resistor to stop the car LED glowing dimly and then through a zener diode to drop the voltage closer to 0 when LED is on the circuit appeared to work.

    However there are two problems:
    1) The circuit appears to be sensitive to light - Works when board is subjected to light
    2) When the engine is running the voltage at the LED with LED ON ranges from .8V-1.4V, I added the zener diode to deal with the fact it was 1V rather than zero but those spikes to 1.4V appears to be enough that even when going through zener diode that the PIC sees the input as positive.

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


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by Bdlhome View Post
    Now I really am going mad or just confused...
    My money is on "going mad"

    To my knowledge no zener diodes are light sensitive, the LED you are monitoring could react to the light, I don't think that is your problem here though. Perhaps you could put up your code you are using. Do you know how these LED's are being controlled? Something different with this one? What value resistor "fairly large" are you using?

    I would simply read from the LED cathode through a 10K resistor to the input pin. Put a 22K resistor pulled down to ground also to that input pin. You may be able to use lower values on the resistors without the pull down resistor turning on the LED, but I would think this would work. Hope this helps some...
    Shawn

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