> I am trying to set up a clock crystal for timer1, so I can keep track of > time while I am in sleep mode. I got the code working fine with an > external 32,768 oscillator (a DS32KHZ tied to T1CLKI), but I am trying > to get it to work with a 32,768 crystal. This is my first time working > with crystals; I always use the internal oscillator, or a ceramic > resonator. Since it works with the external oscillator, I assume my > software setup is ok. I am using this crystal: > > http://rocky.digikey.com/WebLib/Epson/Web%20Data/C-2-TYPE,C-TYPE.pdf > > The symptoms are that timer1 doesn't increment. :-) I have the crystal > connected to T1OSI and T1OSO, and then 33 pF capacitors between those > pins and ground. I have also tried 68 pF, 18 pF, and 68 pF, and just > plain wires. I wrote a simple printf loop to display the value in > timer1 every 1/2 second, and it just sits there. If I wiggle the > crystal, then I get a few increments, so I think the timer is set up > correctly. You don't mention which PIC you are using (could be important), but offhand, even 68pF is a little on the low side. According to the 16F877 datasheet it recommends only 33pF, however it also says the TMR1 osc is like LP mode of the main OSC, in which case 68pF to 100pF is recommended, so there is a conflict there. There is no harm trying a higher value, if 100pF doesn't work give 150pF a shot, it is possible that your crystal is just a little more "picky". Note though, that even on a good day, a 32kHz crystal can take SECONDS to start up, most don't, but I have seen cases where it took a couple of seconds for things to get going. TTYL -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads