Connect with us

if there possible for pic to faulty?

Discussion in 'Microcontrollers, Programming and IoT' started by ikram1991, Jun 11, 2013.

Scroll to continue with content
  1. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    I make circuit for LED.
    But after I finish connect all component the led turn on it self.
    If I connect the vss pin to ground the LED is turn off and circuit is not working like I'm program. If there any possible my PIC is faulty?
    THX
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    11,532
    2,656
    Nov 17, 2011
    Yes, of course.

    Show us your schematic. From the textual description we can't possibly tell.
     
  3. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    This is my coding and my circuit. Actually its a simple led circuit.
    Sorry I'm beginner.:eek:
     

    Attached Files:

  4. gorgon

    gorgon

    603
    24
    Jun 6, 2011
    Is there any more infrastructure around the micro, like power/ reset/ decoupling?

    You say you put Vss to ground?
    You are supposed to put Vss to ground(0V) and Vdd to +5V, for the PIC to work at all!

    How do you know that you have programmed the PIC at all, and your program is running? How do you verify this?

    Since I've never done PIC C, please forgive me if I'm wrong, but the way you use 'SW1' without refreshing it looks iffy to me. I could tell more if you listed the assembler code generated from your C code.
     
  5. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    "SW1" is #defined to a bit in an I/O port register, so every time it's tested in the while (1) loop, the actual pin state is being checked. (Those I/O register bits would also be declared as volatile in the header file.)
     
  6. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    Actually I already run the simulation from proteus that how I verify it.
    When i connect vdd to +5V the led is turn on and after that I connect vss pin or any pin to ground nothing happen. Power source is battery 9V I lower the voltage using VDR circuit and I get almost 6V voltage value. If there okay power up PIC with over 5.5V?
     
  7. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    By "VDR circuit", do you mean a voltage divider made with two resistors? No, you shouldn't use a voltage divider to provide power to the PIC. Use a small 5V regulator such as a 78L05 (see http://www.digikey.com/product-detail/en/MC78L05ACP/MC78L05ACPFS-ND/1049368). These need a decoupling capacitor (e.g. 0.1 uF ceramic) across the input, and another across the output.

    Your circuit should have the PIC's VDD pin permanently connected to the supply rail, and the VSS pin permanently connected to the 0V rail. Turn the circuit on and off with a switch in series with the positive wire from the battery.
     
  8. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    Owh, I see. So VDR circuit is not eficient to lower the voltage.
    If there any possiblity pic faulty because of the voltage more than 5V?
     
  9. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    A voltage divider is inefficient, but it also will not provide a stable output voltage. This is because the current drawn by the PIC (which includes the current drawn by the LED, which flows through the PIC) affects the currents in the voltage divider, and this affects the output voltage.

    In this case, the LED is the main load on the voltage divider. If you adjusted the voltage divider resistors to give roughly 5.5V when the LED was ON, then when the LED turns OFF (or tries to turn OFF), that load current will disappear, and the voltage divider's output voltage will increase.

    A voltage divider will only produce a correct and stable output voltage if the current being drawn from it is a lot lower than the current flowing in the voltage divider resistors themselves. You can increase the "stiffness" of the voltage divider by reducing the resistor values, but this wastes more power in the voltage divider.

    The simple answer is that voltage dividers are not normally used to provide power supply rails to circuits; an active regulator is needed. Using a 78L05 will reduce the wasted power, and increase the regulation of the PIC's power supply voltage.

    Yes, it's possible that you have damaged the PIC with overvoltage. This is especially likely if you used low resistances in the voltage divider. What values did you use?
     
    Last edited: Jun 12, 2013
  10. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    That's is good explaination sir. Now I'm understand.
    Actually I try and error in my VDR circuit
    R1=1K R2=10K or R1 and R2 is 10K. :D
     
  11. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    OK, those resistances would limit the current that flows into the PIC, so it probably has not been damaged. It's possible that it's damaged, but try it with a regulator first; it may be fine.
     
  12. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    You also need to pull up the \MCLR pin in order for the PIC to run.

    Bob
     
  13. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    Owh I see. Today I will go get all that stuff.
    Wish me luck.:D
     
  14. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    Voltage is okay now. But nothing happen.
    I already change the pic and using voltage regulator.
    If there anything involve with mclr pin?
    :confused:
     
    Last edited: Jun 13, 2013
  15. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Did you see Bob's post? He says you need to pull the -MCLR pin up. That means, connect it through a resistor (e.g. 10k) to VDD.
     
  16. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    I already try connect mclr pin to vdd using 10k ohm resistor.
    Still same result.nothing happen. I forgot to mention my pic model. Pic that I use is 16F877A.;)
     
  17. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Were you able to program the PIC? Did you verify it?
    Does it verify correctly now?
     
  18. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    The other problem could be your configuration word. Please change this from your hex constant to using the

    __CONFIG()

    macro with symbolic names for the settings. Then we can see if you have set something wrongly.

    Bob
     
  19. W4GNS

    W4GNS

    2
    0
    Oct 27, 2012
    Are you also using hardware, or just simulating with Proteus ?
     
  20. ikram1991

    ikram1991

    43
    0
    May 5, 2013
    Hi guys thx for reply. My PIC already start working. I change configuration bit from HS oscillator to XT oscillator. Actually it just try and error, anyone can explain to me? Now I face another problem were I write source code for LED blinking but the LED is not blinking.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-