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.

Weird behavior for a xtal osccilator when building USB circuit.

Status
Not open for further replies.

Triode

Well-Known Member
I am following this project to build a USB interfaced PIC. I have the circuit working. But there's something odd. With the capacitors from the crystal to ground connected as shown the chip didn't do anything, the program has the led light up initially and that didn't happen. with them removed it works, it lights up and detects as a USB device. If I put the caps back in it quits working again. So what I have now is a setup exactly as shown on the web page i linked to on a breadboard but without the caps on the crystal, it just jumps from pin 13 to 14. So what I'm wondering is why is it working without the caps, why doesn't it work with the caps, and is this going to damage anything over time?
Btw, here is the exact crystal I ordered in case there are question about that.
I've always worked with internal oscillators before, so this is a total mystery to me.
 
Last edited:
That sounds like one of the more interesting problems. A crystal that fails to work WITH capacitors?
I've designed boards that use PICs, and I've never had problems with the caps or the crystal running. However, here at work, we use 80C51 variations, and the order of the day is to use a one meg resistor across the crystal's leads. What the difference between these chips is eludes me, but crystals come in different varieties, and this resistor may do the trick.
Good luck with your project.
kenjj

Oops! I saw the response to the OP's question and realize he's right. Disregard this post.
 
Last edited:
Breadboards have about 20pF between the tracks. Won't hurt anything.
Like Bill said you don't need them with a solder less bread board. There only about 200 cap built in them things lol

Wait till you try a 18f14k50 with a 24mhz crystal you'll be bald like me LOL.
 
What you are saying makes sense because the tracks that need 470nf caps are right next to the ground rail which the caps would connect them to. But I don't get why connecting some caps shuts it down. Wouldn't that just make it oscillate at the wrong frequency? That might make the USB connectivity fail, but the program turns on one status light as long as it runs at all.
Now that I have it working it seems good, but what concerns me is that if I make a device based on this and want to put it on a PCB it will be hard to prototype it.
 
additional but related suggestions required

I have this annoying resonator problem. The PIC18F14K50 microcontroller works on internal crystal mode but doesn't start up on external crystal mode unless I tap the resonator lightly with my finger, but even then it doesn't run continually. I guess there is a capacitance or resistance issue at the resonator (too high stray capacitance?). Frequency is 12MHz and capacitance (built into 3-pin resonator) is 22pf. Any suggestions about adding some extra resistance or capacitance to fix this, and if so, where would be best and how much to avoid unnecessary power consumption? I will try the 1M ohm resistor across the resonator outside leads as suggested above, but wonder if it works whether it will eat much extra power. Thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top