Input question from a newbe


Closed Thread
Results 1 to 40 of 40
  1. #1
    Join Date
    Jul 2011
    Posts
    20

    Default Input question from a newbe

    New to this so be gentle on me. I wanted to solve this on my own, but after lots of reading and experimenting I'm now banging my head on the wall.

    I have a prototype board (16F877A based) with 4 buttons that pull RB0-RB3 to ground respectively. I'm having problems reading the input and if it didn't come with a compiled program that worked I would say it needed a pull up resistor.

    Can anyone help me with a simple code snippet to say light LED on RD0 when RB0 is grounded.

    I starter with the following based on reading.

    CMCON = 7
    ADCON1 = 7
    TRISD = %00000000
    TRISB = %11111111

    and then was trying to use if portb.0 in a look but no luck.

    What an I doing wrong? I have the C source for the program that works but don't appear to be able to replicate the same in PBP.

    Thanks,
    Brian

  2. #2
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Replying to my own question, it looks like pull-up resistors was the problem after all. Adding OPTION_REG = $7F and enabling the internal pull-up resistors appears to have solved my problem

  3. #3
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Barely an hour between complete confusion and WOW! it works!!

    Good job, I bet that feels good. I know it does for me when I figure something out... especially after "banging my head on the wall".

    congrats!
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

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

    We all know what you mean, that's for sure. If your walls are located too far away... here's a portable solution...




    Should also grab one of these





    ------==== ====------

    Steve

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

  5. #5
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Thanks for the head banging kit, I have a feeling I will got a lot of use out of it while trying to get up to speed.

    If you guys don't mind I have another probably very fundamental question, but my basic knowledge of electronics and programming is probably dangerous

    For my first Pic project I want to sense the current state of an existing piece of electronics and then be able to control it based on the current state and other inputs that are not part of the existing circuit.

    Below is the basics of the existing circuit.



    I've measured the current (flowing between 3 and 4) when the switch is closed and it is only a few mA so I think I can happily pull point 4 to ground to emulate the switch being pressed.

    For the sensing of the existing circuit and whether the LED is lit, can I just attach point 2 to an input and read a low (using internal pull up resistors)? I didn't know if that would interfere with the existing circuit. For the switch side of things I know I could use a relay or something to completely isolate the two circuits (mine from the existing), but wasn't sure about reading the state of the LED.

    The existing hardware isn't cheap, so I don't want to experiment too much.

    Any help or advice appreciated.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,519


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Hi,
    Since the external circuit operates on 12V the voltage at (2) will be 12V when the LED is off, if you connect that to an input of your PIC, which operates from 5V, current will flow from +12V, thru the resistor, LED and into the PIC's input pin, up thru the internal clamp diode and into the 5V supply line of the PIC and the LED will turn on (with less intensity since the total voltage is 7V instead of 12V).

    Use a high(ish) value resistor between point 4 and your PIC input (say 47k or something). That will limit the current into the PIC to safe level and stop the LED from glowing.


    Same thing with (4) really, if the voltage at (4) is 12V when the button is not pressed and you connect your PIC output (which toggles between 0 and 5V) to (4) it's likely that the external circuit will think the button is pressed no matter if the output is high or low. As you say, a relay or transistor switch should do the trick.

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


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    One little trick I have always liked is to use a lm78L05 to92 cased regulator to feed your input, then you only flow 5v into the pic and it is small as a transistor and cheap too.
    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.

  8. #8
    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 HenrikOlsson View Post
    Hi,
    Since the external circuit operates on 12V the voltage at (2) will be 12V when the LED is off, if you connect that to an input of your PIC, which operates from 5V, current will flow from +12V, thru the resistor, LED and into the PIC's input pin, up thru the internal clamp diode and into the 5V supply line of the PIC and the LED will turn on (with less intensity since the total voltage is 7V instead of 12V).

    Use a high(ish) value resistor between point 4 and your PIC input (say 47k or something). That will limit the current into the PIC to safe level and stop the LED from glowing.


    Same thing with (4) really, if the voltage at (4) is 12V when the button is not pressed and you connect your PIC output (which toggles between 0 and 5V) to (4) it's likely that the external circuit will think the button is pressed no matter if the output is high or low. As you say, a relay or transistor switch should do the trick.
    HenrikOlsson: Thanks, your answer is very helpful and informative. Just to be sure though, when you said point 4 above (for the high value resistor) did you mean point 2?

    With the switch that makes sense, before starting on this I was originally thinking that there was high low and open but as you say it is either 0 or 5V.

    Quote Originally Posted by Archangel View Post
    One little trick I have always liked is to use a lm78L05 to92 cased regulator to feed your input, then you only flow 5v into the pic and it is small as a transistor and cheap too.
    Archangel: That's a neat trick, thank you.

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,519


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Thanks, your answer is very helpful and informative. Just to be sure though, when you said point 4 above (for the high value resistor) did you mean point 2?
    Indeed I did, sorry about that.

    With the switch that makes sense, before starting on this I was originally thinking that there was high low and open but as you say it is either 0 or 5V.
    Actually, you can, instead of switching the output between high and low switch the pin between output (high or low) and input (high impedance). But in this case you'll end up with the same problem as with the LED. When the pin is an input current would flow thru whatever "feeds" the switch, into the PIC pin, up thru the clamp diode and into the 5V rail making the voltage at (4) around 5.5V which might fool the external circuit into thinking the button is pressed. Obviously all this depends on what is actually inside that black box.

  10. #10
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    I created a simulation of two LEDs using a breadboard and and using the 47K Ohm resistor approach it work, I could sense which LED was on or if neither were on.

    However, sometimes it seems to get confused and misread, it is as if there is some interference or noise being picked up. I check all the connections and tried varying the resistors but it still happens.

    Any thought?

    I'm also going to pick up some lm78L05 to92 and give that approach a try as well.

    Thanks again for the help and continued education

  11. #11
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,519


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    I would suggest trying a lower value resistor but it seems you've already done that.

    What is the voltage at the pin (on the PIC) when the LED is on and off? Are you running the PIC on 5V?

  12. #12
    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 HenrikOlsson View Post
    I would suggest trying a lower value resistor but it seems you've already done that.
    I think I found the problem, although not entirely sure why it did what it did. The initial LED circuit had one LED and when I added the second (in haste) I shared the same dropping resistor (based on the fact that that both LEDs would never be on at the same time). Giving each LED its own resistor appears to have solved the problem.

    Quote Originally Posted by HenrikOlsson View Post
    What is the voltage at the pin (on the PIC) when the LED is on and off? Are you running the PIC on 5V?
    The voltage at the pin is 5.6V Off and 0V (0.5mv on my meter) On

    The PIC is running on 5V (via 7805) but both circuits are fed from the same 12V supply, that is how it will be with the final circuit.

    thanks again.

  13. #13
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Update and further question:

    I'm sensing the state of 6 LED's using the resistor approach which a great with 5 out of the 6 LEDs. I'm using a resistor of great enough value not to light the LED.

    The problem with one of the LED is that the sensing is unreliable (sometimes it would read the LED coming on and sometimes it wouldn't). Using a meter I found that when the problem LED was on the voltage was ~1.2V at point 2 of the original diagram where the other 5 were at close to zero. It is strange because all 6 LEDs are in the same circuit. The issue appears to be that the PIC sees the ~1V as high which makes sense.

    I did tried the lm78L05 to92 approach but couldn't stop it causing the LED to be illuminated when the LED was off.

    Any ideas?
    Last edited by Bdlhome; - 13th August 2011 at 13:35.

  14. #14
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    This forum is magic, I ask a question after spending hours trying to fix something and then within an hour I come up with an answer. The answer appears to be use a 5v zener diode is series with the resistor.

    So my next question is what is next weeks lottery numbers?

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

    The one I have
    Steve

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

  16. #16
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Not expecting an answer from Steve because he should have collected his winnings by now

    For everyone else; I want to track when a switch (which is in an existing circuit) is pressed and was hoping to use the same approach. The problem is the voltage is 0.7V when push to make switch is open and 0V when closed and that doesn't appear to be enough of a range.

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

    ADC, comparator?!? Arwe you sure it's just not a sort of open collector output you have on hand? What if you attach a pull up resistor to it.

    In meantime i'll count my millions
    Steve

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

  18. #18
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Not sure what you are trying to do but 0.7v is quite low
    but if that's what you are measuring and assuming its the correct voltage why not fed it via an op amp then adc

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

    the adc is capable to do the job without the opamp in this specific case though.

    (0.7/5)*1023=143
    (0.7/5)*255=36
    Steve

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

  20. #20
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by Bdlhome View Post
    For everyone else; I want to track when a switch (which is in an existing circuit) is pressed and was hoping to use the same approach. The problem is the voltage is 0.7V when push to make switch is open and 0V when closed and that doesn't appear to be enough of a range.

    Probably better for you to define track for your "0.7V" being presented to the PIC....

    1. Immediately being notified when the switch is pressed? - use a comparator with PIC's comparator interrupt.

    2. hopefully catching someone pressing a switch while polling the ADC Result very frequently? - use ADC and a tight main loop.

  21. #21
    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 HankMcSpank View Post
    Probably better for you to define track for your "0.7V" being presented to the PIC....

    1. Immediately being notified when the switch is pressed? - use a comparator with PIC's comparator interrupt.

    2. hopefully catching someone pressing a switch while polling the ADC Result very frequently? - use ADC and a tight main loop.
    Both would probably work, although #1 is probably better for my project. Having said that, I'm using this project as a learning experience, so I will try both.

    Thanks everyone

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

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

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

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

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

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

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

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

  30. #30
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    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

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

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

  33. #33
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    You are probably on the money but very strange indeed, I'm happy to be declared mad if I can solve this

    I will post the code but don't think it is code related as simply reading the state of RB4. I don't know exactly how the LED's are being controlled other than from reading the basic circuit diagram available and metering of the circuit (I know the car diagrams are not very accurate because as an example the switches are all show as straight push to make but one actually has a 1K resistor is series). I've played with various values of resistors and need >1M to get the results expected. What I don't have is a resistor pulled down to ground and will go and try what you suggest now.

    There is definitely something different with this one LED because the other 5 read fine and I swapped the inputs and the problem moved with the LED which is why I don't think it is code or RB4 related.

    Thanks again and will report back soon... I will probably need to test in the morning as I need to run the car to test properly and my daughter is in bed.
    Last edited by Bdlhome; - 8th January 2012 at 04:02.

  34. #34
    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
    My money is on "going mad"
    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...
    spcw1234: I owe you a beer or three! 10K on the input and 22K to ground worked but the dim glow on the LED was very noticeable. However 120K on input and 220K to ground seems to work without the glow.

    I was sure I actually started with that approach but had two problems that I recall;
    1) The LED glowed dimly unless I went very high with resistor value
    2) For what ever reason it didn't seem to work with the engine running or at least not reliably.

    Still need to do some more testing but looks good so far.

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


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Sounds good!
    Shawn

  36. #36
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    This project is determined to drive me mad..

    Seeing that you are on a roll, I have another question if you don't mind.

    Testing was going well until the circuit stopped working all together. On checking the PIC was getting power etc so I tried reflowing the solder on a few points and it started working again. It would work for a few minutes out say 5-10 minutes later I would power on and nothing. This appears to be repeatable, could the 22pf caps or 4Mhz Oscillator be working due to the heat caused by resoldering? I only ask that because there doesn't appear to be anything wrong with solder joints, so I wondered if it is the heat that is causing the circuit to work? I'm going to try swapping out those components and see what happens.

  37. #37
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    If improper solder is the problem, put the board through some simple tests: freezer for a minute, test, under halogen lamp for a minute, test.

    I'd start by melting all the joints with the solder tip (or reflow oven if you have that). It does sound like you have a bad solder. Heat makes metal expand and bridge small gaps.

    Robert

  38. #38
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by Bdlhome View Post
    ... On checking the PIC was getting power etc so I tried reflowing the solder on a few points and it started working again. It would work for a few minutes out say 5-10 minutes later I would power on and nothing. ...
    After rereading your post, I wonder if the PIC could be damaged internally? Since you appear to have a heat gun, try applying a little heat just to the center of the PIC.

    Is it possible that you abused the chip somehow, maybe a little too much current on a pin?

    I've messed up PICs before by forgetting little things like current limitting resistors, short circuits mishandling test leads, etc. LOL The PIC would sometimes keep on working, but not reliably.

    In some cases the damage would be limitted to just that port, everything else would work fine. They really are tough little buggers but there's only so much abuse they can handle from people like me.

  39. #39
    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 Demon View Post
    After rereading your post, I wonder if the PIC could be damaged internally? Since you appear to have a heat gun, try applying a little heat just to the center of the PIC.

    Is it possible that you abused the chip somehow, maybe a little too much current on a pin?

    I've messed up PICs before by forgetting little things like current limitting resistors, short circuits mishandling test leads, etc. LOL The PIC would sometimes keep on working, but not reliably.

    In some cases the damage would be limitted to just that port, everything else would work fine. They really are tough little buggers but there's only so much abuse they can handle from people like me.
    I don't think it is the PIC but I've been wrong before - you only have to read this thread for examples

    When using the soldering iron on just the oscillator pins I don't think there would be enough heat transfer through the tracks and PIC socket to have an effect on the PIC itself. By the way I'm using through hole components and not surface mount.

    I've just replaced the OSC and everything now appears to be working, so either a bad solder joint as you suggested or the component itself. I'm going to try the OSC I removed in another circuit to see if I have the same problem.

  40. #40
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    I had a similar problem on a breadboard; the oscillator pins weren't making perfect contact.

    I had another one on the Lab X1; it would work fine if I lightly touched the oscillator with my fingertip. Resoldering fixed that one.

    Robert

Members who have read this thread : 1

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