Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] How to tell if a MCU is damaged

Status
Not open for further replies.

tigerclaw

Newbie level 6
Joined
Oct 26, 2010
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,414
Hello my name is Arthur i am new here, and reletevly a noob to El,MCU and programming.

So i have this PIC 18F242 and the thing is that i tryed every posible code to light a LED on and off, but no mater what i program it wont even torn on.

In PROMETHEUS 7 it works like a charm with that code.

but in real life...... :roll:

The voltage on the I/O pins is always about 0.5v is that normal? even on the one i programed to turn on and off,

the program is there i checked and verified(PICkit2).

I set it to internal clock (OSC = ECIO)

i decoupled the VDD with a 0.1pF capacitor as recomended.


But i am not shore of one thing.

I dount know how to start the program in the real MCU, i presume i jost need to connect the power and ground connections right?

in the settings of MLAB/Programmer i selected release from reset(after a program write) i asumed that alows to start the program in MCU while connected to programmer.

and it is very possible that i tuched a few pins with the full MCLR voltage for a good moment. I was trying to make a JDM programer to it for a few weeks now :-D and out of frustration i at least once misconnected the MCLR wire.
BTW the serial programmers didnt work for me so i got the PICkit2 from ebay.

So i am missing some thing or did i fry the MCU :twisted:?

Thanks
 

PROMETHEUS 7
Did you mean PROTEUS 7?
Regards,
Jerin.

---------- Post added at 04:22 ---------- Previous post was at 04:17 ----------

Check out these connections:
1) MCLR pin & Vdd pin of the controller are shorted.
2) Proper Vcc & GND are provided to the controller.
3)Vss pin of the controller is GNDed.
4)Proper resistance is provided in front of the connected LED to the controller or the LED may get damaged.
5)Correct value of oscillator is provided & bypass capacitors are also provided.
Regards,
Jerin.
 
Hi,
If you have programmed it successfully, try to read the code off the microcontroller. If you can read it, most probably the microcontroller is not damaged. Check whether you have set the configuration bits properly. Maybe a misconfiguration of the configuration bits and check the connections suggested by incomplete_jerin.
Hope this helps.
Tahmid.
 
ups yes i ment Proteus, and thanks for the check list gonna check it as soon.

And i can read from the MCU with no prob, but i did have some warnings about not all config bits are configured in PICkit2, but not in MLAB. Il look in to it

tanks Tahmid,Jerin
 

Well the config bits seem to be ok,
watchdog is OFF,
oscillator is "EC oscillator w/ OSC2 configured as RA6"
Brown-outV is OFF
Stack Full/Underflow Reset is Enabled


and i basicly tried every combination of the config bits except oscillator bits. and still no good.

The wiring is solid.

But since i manualy checked the config bits by the datasheet i discovered that most likely my PIC18F242 dozent have an internal oscillator, so i am gonna try and use external one.

Wish me good luck, i am gonna need it :-D
 

Post your code and circuit diagram

There may be something wrong
 

the last post was acidental. bug or something.

My code:

#include <p18f242.h>
#include <delays.h>

#pragma config OSC = XT
#pragma config WDT = OFF //Disable watchdog timer

#define LEDPin LATCbits.LATC3 //Define LEDPin as PORT C Pin 1
#define LEDTris TRISCbits.TRISC3 //Define LEDTris as TRISC Pin 1

void main()
{
LEDTris = 0;//Set LED Pin data direction to OUTPUT
LEDPin = 1;//Set LED Pin

while(1)
{
LEDPin = ~LEDPin;//Toggle LED Pin
Delay10KTCYx(25);//Delay 250K cycles (1 second at 1MHz since each instruction takes 4 cycles)
}

}


and the circuit schematic is basikly a LED(3mm) connected to pin 14(RC3) of PIC18F242 thru a 1k resistor. And the rest.... well i dount really know how to properly connect the mcu with an oscillator. I am researching it now.
 

There is no need for a 1K resistor. You need a max value of 330ohms. 220 is desirable value. Just replace it & check.It is because the min current required for a LED to blink is denied when you use a 1K resistor as you know LED operates @ a current of 20mA.Also check as nandhu has said.
Regards,
Jerin.
 

Well i had some luck recently i manage to light the LED, but i have no idea how i did it :D, and was unable to repeat the success. Can you tell me how to start the program on the pic it self. And is it ok to do this type of project on a breadboard ?

thanks for the help so far.
Cheers
 

Programming in assembly language would increase your logic in implementing this over a code & i would like to advice you to start the coding of the PIC in assembly language & do work the controller in real-time i.e in bread board & check it operation of working..... Many tutorials are available for learning assembly language coding for PIC.Select some nice tutorials & start learning. Post your doubts here & get it cleared.Wish you good luck......!!!!!!!!!
Regards,
Jerin. ;-)
 

Hi,
Simple projects that do not include high frequency stuff like SMPS, are fine on the breadboard. I would suggest you grab a book, preferably the one by Mazidi, the datasheet and reference manual and start reading them and practicing. You'll get a grip of the PIC18 in a short time.

Hope this helps.
Tahmid.
 

Well it looks like i didnt connect the oscillator corectly, Bicese i bought a 18f2550 with an internal oscillator and it work quite good, it makes some strange things but thats most likly of the diferent configurations of thous PICs looking up the datasheet now :].


Any ways thanks for the advice, and yes i am already reading a few books about PIC MCUs and El. Hope to make some really cool project soon.


one more question.... is this an Indian board?

Cheers
 

Not important i just noticed that all of you guys are Indians so i wonder. :)
 

My apologies Tahmid, Didnt realized that.

Btw I am Russian but i live in Czech rep.
 

Btw I am Russian but i live in Czech rep.
Ten years ago, when edaboard was called elektroda, one might have thought that this was a Polish or Russian forum. The demographics seem to have changed quite a bit in the last few years.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top