need help getting started with a pic16f84a

Thread Starter

optionfa

Joined Nov 2, 2009
15
by development board do you mean the pickit2 module? I am not using the dev board that came with the starter kit, since I had to rewire the socket I just wired the 5 pins from the pickit2 to vcc vss mclr rb7,6 on my breadboard.

I was under the impression that the MCU was a stand alone unit and just needed a Vcc in my final circuit. Can you please explain what you mean by swapping a 4MHz crystal?

This is how I have it set up, is there some external circuitry on the dev board that I need to wire for this to work?



I managed to read and write to the MCU, but I get no output on RB0,1,2.
 

Markd77

Joined Sep 7, 2009
2,806
Have a look at section 6.2 in the datasheet. It shows the connection of the crystal and capacitors required for this chip. Some of the newer chips have built in oscillators but they may not be as accurate or temperature stable as a crystal.
The only other thing you need is to connect MCLR to VDD with a 1K resistor.

For testing you could also feed a logic level clock signal into OSC1, leaving OSC2 unconnected if you have the right test gear.
 
Last edited:

BMorse

Joined Sep 26, 2009
2,675
by development board do you mean the pickit2 module? I am not using the dev board that came with the starter kit, since I had to rewire the socket I just wired the 5 pins from the pickit2 to vcc vss mclr rb7,6 on my breadboard.

I was under the impression that the MCU was a stand alone unit and just needed a Vcc in my final circuit. Can you please explain what you mean by swapping a 4MHz crystal?

This is how I have it set up, is there some external circuitry on the dev board that I need to wire for this to work?



I managed to read and write to the MCU, but I get no output on RB0,1,2.

In order for it to run on the breadboard you will need to install the crystal + caps, and a pullup resistor to VCC for MCLR, and Make sure you have +5 to the breadboard to power the Pic..... You might be able to program it without any of these connections, but it will not run without them....



My .02
 

Thread Starter

optionfa

Joined Nov 2, 2009
15
Ah! so I am missing some external circuitry, should have read over the data sheet a little better.

Looks like I need a 4MHz crystal, Digikey must love me they are making a killing from all the separate shipping costs I have been paying : P. Cheers guys, lets hope I can get this up and running once I get this crystal in, I appreciate everyone's patience with my many questions.
 

BMorse

Joined Sep 26, 2009
2,675
Ah! so I am missing some external circuitry, should have read over the data sheet a little better.

Looks like I need a 4MHz crystal, Digikey must love me they are making a killing from all the separate shipping costs I have been paying : P. Cheers guys, lets hope I can get this up and running once I get this crystal in, I appreciate everyone's patience with my many questions.

Part numbers of 4Mhz Crystal I use for 4 Mhz clocking is this from digikey >> http://search.digikey.com/scripts/D...ink=hp_go_button&KeyWords=300-8469-ND&x=0&y=0

capacitors to use with the above crystals >>> http://search.digikey.com/scripts/DkSearch/dksus.dll?vendor=0&keywords=1329PH-ND

with those components I have clocked a pretty consistent 3.98Mhz, which I think is pretty good....

I use both with most pics that require 4Mhz.....


P.S.
Here is a picture of my pickit 2 right now, connected to a Pic16F887 uc.....
and a pic of the prototype PCB for the circuit I am now prototyping on the breadboard...

My .02
 

Attachments

Last edited:

THE_RB

Joined Feb 11, 2008
5,438
...
with those components I have clocked a pretty consistent 3.98Mhz, which I think is pretty good....

...
That sounds way off frequency to me.

Those xtals are 4.00MHz and rated for +/-30PPM accuracy. You should be getting 3.9999 Mhz.

The 8MHz xtals I get in the same size package as the ones you link to have tested WELL under +/-15PPM, at least at room temperature here which was about 27'C (I think they are specced at 25'C).
 

Markd77

Joined Sep 7, 2009
2,806
I make it 3.99988 to 4.00012 MHz for 30ppm - (so 3.9999 is correct at that rounding) although I can't see that level of accuracy being critical in most applications - except clocks.
 
Last edited:

BMorse

Joined Sep 26, 2009
2,675
That sounds way off frequency to me.

Those xtals are 4.00MHz and rated for +/-30PPM accuracy. You should be getting 3.9999 Mhz.

The 8MHz xtals I get in the same size package as the ones you link to have tested WELL under +/-15PPM, at least at room temperature here which was about 27'C (I think they are specced at 25'C).

When I measured this freq, I had it on a breadboard (Stray capacitance and all), on the actual circuit PCB it is much closer to the 4.0001
 

THE_RB

Joined Feb 11, 2008
5,438
Ahh, that makes sense now. :)

Breadboards are often about 50pF from track to track, so they can give very "out of spec" xtal speed. If there is a ground track next to the xtal tracks (like on most PICs) you can run probably the xtal with no caps.
 

pendi87

Joined Jan 11, 2010
3
what type of converter that u use?it is inverter or rectifier?if inverter which convert dc to ac, which conduction type that u use...180 degree conduction or 120 degree conduction?I'm also face the same problem as your..
 
Top