Alice, Making reluctant oscillators start is a black art whether on PICs or other processors. I have had recent interesting experience on Z8s. Capacitor values depend not only on the IC but on the crystal characteristics and the crystal manufacturer will have recommended specs for their crystal. If you are using "any-old-crystal" with unknown spec you may be advised to use a part which the manufacturer will provide advice on. The capacitors fill several roles. They increase phase shift (180 degrees of phase shift is of course required to make an inverting gate into an oscillator). The output capacitor will generally attenuate overtones and if too small MAY allow overtone oscillation. Generally making capacitors as small as possible will improve startup times. I would consider 47 pF is FAR too large for most crystals and even 33pF is also probably too large. I would first try 2 caps around 18 pF. Also you MAY find that the oscillator will run happily with one of the capacitors absent (not a normal situation!). Looking at the oscillator pins with an oscilloscope when it IS running will give you some guidance. Output should be near rail to rail but not clipping and input should be "healthy" (say 1/4 rail peak to peak maybe). remember that Scope will affect signal. A low output voltage swing shows the oscillator is having trouble. Try heating the board with a hair dryer (careful not to hot spot to death - I deflect air off my hand if I really want to ensure its not too hot) and watch the oscillator signal as it heats up. Try various fixes as below and heat test again to see how this affects it. If it runs badly when hot then chances are it will start less happily too. As usual, YMWV. Layout can matter but I suspect that if it gets down to critical layout then something else is very wrong. All the guides say traces from crystal to IC should be short and wide to decrease inductance and resistance. Capacitor leads should be short also to reduce inductance (Now we ARE getting desperate :-)). It is often said that the caps should be returned to a noise free ground trace but with PICs I usually return caps grounded end to the Vcc rail - arguably any noise helps to spread the oscillator with improvements to EMI! Others will disagree. Adding resistance across the oscillator pins will change the gain of the internal amplifier. You MAY get some success by using another mode and adding an external resistor. Bit desperate though. Try HS mode and 1 Mohm for starters. Summary, lessee - - Try MUCH smaller caps. - Try NO cap in one position. - Be sure you know where your crystals come from and how their mom says they should be used. - Consider layout if desperate. - Resistor across osc and different osc mode YMMV :-( Russell McMahon _____________________________ What can one man* do? Help the hungry at no cost to yourself! at http://www.thehungersite.com/ (* - or woman, child or internet enabled intelligent entity :-)) From other worlds: www.changingourworld.com www.easttimor.com www.sudan.com -----Original Message----- >From: Alice Campbell [mailto:1502AMC@lo.scseng.com] >Once i discovered that the ADC in my datalogger wouldnt run >at 33 kHz, i replaced the watch crystal with a 4 MHz crystal. > There are two caps, 47 pF. The dataloggers live outside,and >sleep 7 minutes to one hour. Its pretty hot out, about 100 >deg or more in the daytime. I have a temperature >compensation routine to correct the sleep time for >temperature, that isn't the problem. While the circuits run >pretty well under about 80 deg, once they get hot, they only >sluggishly wake up, one hardly wakes up at all. I tried a >.1uF cap across the pic's power pin to ground, to boost it a >little, helped a little but not fixed. I changed the caps to >33 pf but thats worse. The capacitance of my finger will >generally wake up the more sluggish unit, but i really cant >stand around all day slapping the thing to make it run. Im >starting to reach for the big rubber mallet, does anyone have >any suggestions? -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements