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.

16F84 oscillation strangeness

Status
Not open for further replies.

bonxer

New Member
I've just started trying to get a PIC 16F84 to work. I bought a programmer, the PIC, some oscillators, and components. I went through a tutorial to make an LED blink, and couldn't figure out why it wasn't working. Turns out it was running too slow. I have a 4 MHz crystal connected, and have delays set to try to make the blink visible. After decreasing the delays, I can see it change once every 8 seconds or so. After removing the delay completely, it blinks a few times per second. So I set up port B to output to a 7 segment display, and can clearly see it cycle through all digits 0 through 9 within a second.

After looking at the post right below concerning appropriate crystals, I noticed that all the ones I bought were series crystals. So I suppose that is part of the problem. The thing that grabbed my attention, though, is that when I went to switch crystals, I did not power off the circuit. I just yanked the crystal out. The PIC continued to operate and display numbers at the same rate, with only 22pF caps on the osc pins connecting to ground. I also noticed that if I remove the caps and just stick a wire in to the osc1 pin, it will run as long as I am touching it.

So my questions are:
A. Is there a way to get a PIC chip to run properly with my series crystals, or should I just throw them in my toolbox and look for parallel ones?

B. Why was the PIC even able to operate in the first place with only a capacitor or wire/finger on OSC1, with no resistor or crystal or anything else?
 
For you first question: I think most microcontrollers are designed to work with a parallel crystal. You're probably better of just using one of those.

For your second question: All the wireing in you house emits a 60Hz (or 50Hz depending on where you live) signal. Your body of the wire acts like an antenna coupling this signal into the controller - might be enough to make it work but its operation will be really unpredictable and strange.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top