PIC crystal oscillator

Hi everyone!

Is it safe to kill a PIC (16F628) crystal oscillator by shorting the OSC1 to ground through a diode (1N4148 or BAT...Schottky)? I put this PIC in standby mode by pulling low MCLR. All pins goes to input state but the oscillator keeps running and I want to kill it too. SLEEP is not an option in my case because I'm stuck with a weird design.

Merry Christmas! Al

Reply to
A. Lemon
Loading thread data ...

If OSC1 is the INPUT to the inverter, no problem.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

OSC1 is indeed the inverter input. It does kill the oscillation but I was not sure if the PIC would appreciate.

Thanks!

Reply to
A. Lemon

The MCLR is also pulled to ground at the same time. The it is pulled up to

+5V at the same time as the diode is reverse biased at the oscillator. I may have a point though. I'll have to check if there is any oscillator delay and/or start-up timer upon MCLR reset.

Al

Reply to
A. Lemon

It may not be safe for the execution of your program. It won't hurt the oscillator, however.

The problem is that you will be clipping off some fraction of the current clock cycle, and the oscillator will muddle back into operation when you release the ground, producing who knows what clock waveform for a very many cycles. Can you use the internal RC oscillator or an external oscillator, instead?

Reply to
John Popelish

I think the option is called POR (power on reset delay). This option should always be enabled if you use a crystal oscillator without an external MCLR release delay, to let the oscillator come up to full amplitude.

Reply to
John Popelish

Unfortunately POR delay works only at power up, not with MCLR reset... if I understand the datasheet correctly. The diode shut-off circuit seems to work but it is most probably a "durty" solution!

Al

Reply to
A. Lemon

You could add an RC delay that holds MCLR a while after the oscilltor is released.

Reply to
John Popelish

The PIC16F684 (and probably others) has a two speed clock start-up mode which uses the internal oscillator until the external clock has stabilized. It also has a fail-safe clock monitor which detects abnormal clock operation and allows the processor to run on the internal clock. You can also switch from external to internal clock on-the-fly and possibly shut down the external clock oscillator in this way. An unused output pin might even be able to shut down the PIC's own external clock once it is running on the low speed internal clock, and then go to sleep. Good luck.

Paul

Reply to
Paul E. Schoen

Yep! This is a very good idea. My MCLR pin is set through a 22K resistor, I could add 1uF cap to delay the reset about 20mS to allow the oscillator to stabilize. This should clean up the "dirty" solution ;)

(Even though in another message, Paul E. Schoen says the oscillator can be switched off without this precaution).

Al

Reply to
A. Lemon

(I meant: the oscillator can be switched ON without this precaution)

Reply to
A. Lemon

Why not just power it down via VCC pin? Then you guarantee to get OST (oscillator start up timer) operation when you power it back up?

Luhan

Reply to
Luhan

I want to keep its power up because it remains connected to another circuit via a connector. If I power it down, its pins behave like diode to ground and loads the other circuit. Keeping the PIC in reset mode puts all its pins in input mode or hi-z without loading effect. Its an easy way to isolate both circuits and without disconnecting them for each other. I know I could let the oscillator running but I just try to keep power as low as possible.

Al

Reply to
A. Lemon

I found that the pin compatible PIC16F628A version has the two speed clock and nanowatt technology which allows it to sleep at 100 nA current. Sleep also disables the clock oscillator. You could tristate all pins before sleep mode to essentially disconnect it. It may actually draw less power than holding MCLR low as well as the CLK IN pin, as they probably have some current draw through internal pullups and other circuitry.

Paul

Reply to
Paul E. Schoen

That would be the better solution indeed. Unfortunately I don't have the source code. That's why I have to rely on this trick for now. The current consumption is however acceptable even though not in the nanowatt range. It's under 10uA as far as my meter can measure.

Al

Reply to
A. Lemon

The PIC should be a DC to XXMHz part, so a stopped clock is no problem. Whether it can come back alive in a known state is another situation unless you make sure you don't short cycle the IC by killing the OSC in the middle of the wave form.

Jim

Reply to
James Beck

as others have said this heavy-handed approach to the clock could cause problems on restart if the last pulse was only partial. unless you can reset the micro each time you restart it might be safer to use an external clock.

Bye. Jasen

Reply to
jasen

We also have used the ceramic resonator with build in caps. Put a 1 MegOhm resistor across the OSC pins. This will delay the first clock pulse, Take a look at this circuit.

formatting link

Reply to
2007 Amy

Why not include the 1 meg resistor?

Reply to
John Popelish

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.