Did my microcontroller ( PIC16F877A ) burn ?

Thread Starter

kareem3d

Joined Jan 7, 2012
10
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 :(
 

Markd77

Joined Sep 7, 2009
2,806
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?
 

t06afre

Joined May 11, 2009
5,934
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.
 

Markd77

Joined Sep 7, 2009
2,806
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.
 

ErnieM

Joined Apr 24, 2011
8,377
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.
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.
 

Thread Starter

kareem3d

Joined Jan 7, 2012
10
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.
 

Markd77

Joined Sep 7, 2009
2,806
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.
 

Markd77

Joined Sep 7, 2009
2,806
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.

I don't know C but someone will probably have a look at the code.
 

Attachments

Last edited:

t06afre

Joined May 11, 2009
5,934
@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
Rich (BB code):
void main() {
portd.b2 = 0;
trisd=0b11111011; //unused pins as input
while(1){
if(portd.b1==0)
portd.b2=1;
}
 

Thread Starter

kareem3d

Joined Jan 7, 2012
10
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.
 

t06afre

Joined May 11, 2009
5,934
t06afre
i will try that .. but the instructor told us that all pins are input default !
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?
 

MrChips

Joined Oct 2, 2009
30,824
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.
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.
 

CVMichael

Joined Aug 3, 2007
419
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.
 

MrChips

Joined Oct 2, 2009
30,824
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.
 
Top