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.

[PIC] PIC16F877A correct wiring and the external clock?

Status
Not open for further replies.

Tinkerer_of_Things

Newbie level 3
Joined
Mar 30, 2019
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
33
Greetings.

Im attempting to connect my first pic and have it blink an led with a simple program i wrote. However its not working and i could use some help.

Everything works when i connect it on proteus 8 however when i try connect on breadboard it doesn't do anything. I dont know if some crystal is needed to be connected to OSC1 and OSC2? I connected 5V to both Vdd pins and ground to both Vss. and an led to pin 15 the RC0.

I did manage to use MPLABxIPE to program the pic so im glad i at least did something right :D

I'm using a PIC16F877a and here is the code i wrote:

Code:
void main() 
{
 PortC = 0;
 TrisC = 0b00000000;
 ADCON1 = 7;
 CMCON = 7;
 while(1)
 {
  RC0_bit = 1;
  Delay_ms(1000);
  RC0_bit = 0;
  Delay_ms(1000);
 }
}
Any guidance is much appreciated.
 

Hi,

Proteus doesn't care about
* clock circuit,
* power supply, it's impedance and correct use of capacitors
* current drawn by the circuitry connected to the ports
* floating ports
And so on.

Thus by far not every circuit that works on Proteus will run in reality.

If you want us to check your circuit, show us your complete schematic and post a couple of photos.

Klaus
 
What does the pic use this internal RC oscillator for if its not for the processor?

Thank you so muchfor clarifying this! I was confused why the pic would work with/without an oscillator on Proteus but that wasn't the case on hardware.
 

Forgive me i forgot to mention i used MikroC for PIC to write the code and it seems to have a nifty way of setting configuration bits before you begin writing the code. I have attached a picture of what i think it we are talking about please take a look.

Capture.PNG
 

So what? All these options are discussed in the data sheet in detail.

As already explained, you need to select a valid clocking method, provide the required components, either crystal, ceramic resonator, RC circuit or external oscillator and program the option respectively.

The other config bits listed in your post have various purposes. You don't need to learn all at once and can keep the default setting for the time being.

Or use a recent PIC with internal oscillator and save the additional external hardware.
 
So what? All these options are discussed in the data sheet in detail.

As already explained, you need to select a valid clocking method, provide the required components, either crystal, ceramic resonator, RC circuit or external oscillator and program the option respectively.

The other config bits listed in your post have various purposes. You don't need to learn all at once and can keep the default setting for the time being.

Or use a recent PIC with internal oscillator and save the additional external hardware.

Ok noted thank you Sir.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top