Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC18F4520 BASIC Circuit

Status
Not open for further replies.

noobC

New Member
Hi guys, what are the minimum circuit required to start the circuits? What are the Pins that we can ignore?

I had patched the circuit as given in PICDEM 2 Plus schematics but it is not working. Then I used a breadboard to patch the circuit And it is not working as well.

I had only patched the followings:

Pin 1 to MCLR
Pin 11 to +5V
Pin 12 to GND
Pin 13 to Oscillator
Pin 14 to Oscillator
Pin 31 to GND
Pin 32 to +5V

the programming is as followed:

#include <p18f4520.h>
#include <delays.h>
void main(){
int i;

ADCON1=0x0F;
PORTB=0x00;
TRISC=0x00;
TRISB=0x00;

while(1) {
Delay10KTCYx(15);
LATB=0x00;
Delay10KTCYx(150);
LATB=0b11111111;
LATC=0b00001001;
}

I programmed the PIC using PICDEMO 2 Plus, then remove the RJ-11 cable and the LED (PORT B 0-3)lit up, hence software shld be working.

When I remove the Chip and put in the circuit I made, there is not voltage at Port B.

I had measure the followings:

Pin 1 supposed to be 5V and GND when "reset" is switch pressed, and it work well
Pin 11 supposed to be 5V, I measured 5V
Pin 12 supposed to be GND, I measured GND
Pin 31 supposed to be GND, I measured GND
Pin 32 supposed to be 5V, I measured 5V

Pin 34-40 supposed to be alternating between 5V and GND, NO VOLTAGE IS DETECTED

Hence I had concluded that the microchip is not working or "switch on". Is there any thing I miss out in the hardware circuit that I have to include? or would it be some other reasons why the circuit is not working

Pls help, Thanks
 
how to check config setting? Could it due to the oscillator setting? Because My oscillator is tap on pin 13 and pin 14 which is RA7 and RA6.

The oscillator setting I check is EXT RC Port on RA6
 
Hi because I had done MOST of my program already using timer and it is hard for me to turn back to change the whole program because of hardware.

Because this, you had mentioned the CONFIG setting... Do i have to include it into my program ? Is the config setting means CONFIG1H? Then based on my circuit, what do you suggest me to configure in the register?
 
Yes the CONFIG1x settings should be part of your program. Without seeing your schematic I can't tell you what your config setting should be.
 
Hi I attach the schematic of my hardware.

I had only attached these pins and I used Multimeter to measure the voltage at Port B.

Pin 1 to MCLR
Pin 11 to +5V
Pin 12 to GND
Pin 13 to Oscillator
Pin 14 to Oscillator
Pin 31 to GND
Pin 32 to +5V

Thanks
 

Attachments

  • Pic1.JPG
    Pic1.JPG
    2.4 MB · Views: 793
I am not able to use the command "" CONFIG1H=0b00000001; ""

There is a configuration bit where I can adjust the oscillator, I had change the oscillator to XT and Programmed it but it is still no working.
 
I am not able to use the command "" CONFIG1H=0b00000001; ""

There is a configuration bit where I can adjust the oscillator, I had change the oscillator to XT and Programmed it but it is still no working.

I had attached a screen shot on what is available.
 

Attachments

  • 2.JPG
    2.JPG
    210 KB · Views: 334
Oh yes, I do have a ICD 2, I used ICD 2 and PIC Demo 2Plus Board to "PROGRAM" the PIC, then I took out the PIC and transfer it to my DIY circuit. That is where it is not working.

After I programmed the PIC with ICD2 and PICDEM 2 Plus, I took out RJ-11 cable and the LED lits up as the program. But when I took out the PIC and put it into my hardware, it is not working.
 
Try using the internal 4MHz osc for starters, just eliminates the crystal from the problem. You also need those 0.1uF caps near the PIC.
 
Thanks for your help,

Sorry I would not be able to use internal Oscillator because I had done MOST of my program already using timer and it is hard for me to turn back to change the whole program because of hardware.

do you know anything about the config setting??
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top