Did my microcontroller ( PIC16F877A ) burn ?

Discussion in 'Embedded Systems and Microcontrollers' started by kareem3d, Feb 26, 2012.

  1. kareem3d

    Thread Starter New Member

    Jan 7, 2012
    10
    0
    Hi i have PIC16F877A , i used PICkit 2 v2.61 to program this chip..
    At the first time i made all the connections right , except i put a 4MHZ oscillator with the micro and on the programmer was writtern 20MHZ -- i didn't see that the first time -- ,, the PICkit identified the microcontroller and i tried to write a program but an error message "Verification of configuration failed" , i tried maybe 5 more times again with different hex files but the same error message occurred
    Then i smelt something burning i put my hand on the microcontroller and it was burning !!!
    I unplugged the programmer and the next day i tried again without putting the 4MHZ oscillator and the same message occured i searched on the internet & solved this message ( i guess ) .
    When i wrote a very very simple program on it the PICkit said it was successfully written, but when i made the the connections it didn't work !!
    so i am afraid that my microcontroller did burn :(
    If there's a way to test the micro or something ??

    Hope you give me good news :(
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    They are tough little chips, so it might be OK, depends exactly what happened.
    It's probably easiest to get a new one, make sure you can program it correctly and then compare with the old one.
    Can we look at your simple test code to check it should work.
    Also exactly what is connected to the PIC in it's test position?
     
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Did you find out why the chip is so hot. It may be broken. But also, you may have some errors in your wireing. Can you take chip out of the circuit. And just connect it to the PICKIT 2. For a funtion test.
     
  4. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    I made one very hot by connecting the programmer MCLR wire (13V when programming) to a pin that wasn't MCLR. Everything still worked afterwards, but that's just luck.
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    What pin was that? Is it possible you just killed that particular pin, which is something I've done: PIC works except one pin is a brick.

    Driving the MCLR VPP into a pin is not good: the ESD diode will use that to drive the Vdd line to VPP and that can take out lots of stuff if the pin doesn't open first.
     
  6. kareem3d

    Thread Starter New Member

    Jan 7, 2012
    10
    0
    code :
    void main() {
    portd.b2 = 0;
    trisd.b2=0;
    while(1){
    if(portd.b1==0)
    portd.b2=1;
    }
    }

    The led should give light when i close the switch , but that's doesn't happen ! :(


    "It's probably easiest to get a new one" Markd77
    Acutally in my country it's kinda hard to get one and expensive.
     
  7. kareem3d

    Thread Starter New Member

    Jan 7, 2012
    10
    0
  8. kareem3d

    Thread Starter New Member

    Jan 7, 2012
    10
    0
  9. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Just a normal I/O pin I think, and that pin was OK afterwards. I smelled that hot plastic smell and it was too hot to handle. Another couple of seconds and it probably wouldn't have made it.
     
  10. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    You seem to be missing the capacitors to ground for your crystal, 15pF should be the right size.
    The oscillator section should have no long wires.
    Also MCLR pin should be connected to 5V with a 10K resistor.
    A 100nF capacitor should be connected between the 0V and 5V pins as close to the PIC as possible.
    [​IMG]
    I don't know C but someone will probably have a look at the code.
     
    Last edited: Feb 26, 2012
  11. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    @kareem3d
    If your schematic is the one you use should not your code be. And is the configuration bits properly set? That is very important
    Code ( (Unknown Language)):
    1.  
    2. void main() {
    3. portd.b2 = 0;
    4. trisd=0b11111011; //unused pins as input
    5. while(1){
    6. if(portd.b1==0)
    7. portd.b2=1;
    8. }
    9.  
     
  12. kareem3d

    Thread Starter New Member

    Jan 7, 2012
    10
    0
    i think the capacitors to filter the signal clock , it's used when you are working in industries where there's a lot of noise.
     
  13. kareem3d

    Thread Starter New Member

    Jan 7, 2012
    10
    0
    t06afre
    i will try that .. but the instructor told us that all pins are input default !
     
  14. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Yes that is correct. But make it habbit of setting the full tris register then programming. It makes it more easy to read the code. I also see you use Proteus. Does it not work in Proteus also?
     
  15. kareem3d

    Thread Starter New Member

    Jan 7, 2012
    10
    0
    no it works great in proteus
     
  16. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    NO!

    The capacitors on the XTAL circuit have nothing to do with noise.

    These are required because it is a tuned oscillator.

    ALSO: Put a 0.1 uF capacitor between VDD and VSS as close to the chip pins as you can get.

    ALSO: Put a 10uF electrolytic capacitor between VDD and VSS somewhere on the board.
     
  17. CVMichael

    Senior Member

    Aug 3, 2007
    416
    17
    If it got hot it means you connected some wires/pins wrong... the PIC should not get hot from crystal, unless it's way overclocked.

    I overclocked a PIC16F877 to 24MHz, and it did not even get warm.

    Lately I use PICs that I run at full speed with internal clock. For example right now I work with PIC18F26K80 that has 16MHz internal clock and also has 4x PLL, this means it runs at 64MHz (it's full speed) using internal clock.
     
  18. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    A PIC chip can get hot if there is a power spike. It can suffer from CMOS latch-up which does not go away until you power down the circuit. That is why it is important to put a 10uF electrolytic on the power supply line.
     
Loading...