Oscillator not...well, oscillating

Jan 03, 2006 9 Replies

Hi all,



I have just built my first dsPIC-based circuit, with a 30F3011 and



20MHz oscillator. However, I cannot get the thing to talk to my ICD2. It seems the oscillator is not running; CLKOUT is at a constant 5V and CLKIN is close to ground (I am using an oscillator with built-in caps). Could this be because the PIC doesn't know there is an oscillator connected and is not driving it? If so, how do I program that fuse without the ICD running? Of course it may be a stupid error, but I have thoroughly checked the 3 connections between PIC and oscillator!

Thanks!



Angus



Assuming you are using MPLAB, go to the 'configuration' section and make sure yu have selected the appropriate oscillator source.

Specifically, go to 'Configure' on the main menu

Select 'Configuration bits'

The various oscillators are in a drop down list box

Cheers

PeteS

Be careful with your terminology. An oscillator is something that, when you apply the correct power to it you can reasonably expect to get signal out. It sounds like you are talking about a resonator, probably a ceramic one although I did not realize these were available up to

20MHz. A resonator, by itself, is just a dead thing that rings at the design frequency when properly excited -- it needs to be connected (correctly) to an amplifier to make an oscillator.
Tim Wescott Wescott Design Services http://www.wescottdesign.com

One other thing to look into, I understand at least on the early dsPICs the ICD would only work on one of the debug ports, though the chip was supposed to support multiple ones that could be configured. This comes from a friend who built a project with the 30F6014 and learned this the hard way. This fact wasn't published, but Microchip did know abou it.

If all else fails, it may be something to ask when you contact them for tech support.

Hello Angus,

I'm not sure about the dsPIC, but in order to get crystals connected to PIC's to oscillate you need to set the configuration bits properly according to your design. As mentioned by others, crystals need external excitation in order to work but the PIC needs to be configured to properly excite the crystal connected. I imagine the dsPIC is simlilar.

James.

They never do! try building an amplifier with lots of pen loop gain, they always oscillate.... ;_)

Marc

There's just one thing about that. How does the PIC read the configuration bits if its clock isn't running ?

Graham

Well, thanks to all of you for the advice. For the time being, I'll put aside the idea of building an amplifier to give me oscillations! Am still looking into the problem, as setting the configuration bits doesn't seem to solve it. I will post the answer if and when I fix it!

Oh, and in answer to an earlier question, my terminology was a bit wrong; I am indeed using a resonator!

Cheers! Angus

If you want an oscillator, then build an amplifier!

Perhaps the resonator has too much loss? Set up a CMOS inverter with a 1meg feedback and then use the same capacitor values and resonator configuration. Thensee what is or is not at the output...

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required