Pull the xtal leads out of the SBB and solder the crystal (shortest possible leads) directly to the pins. GROUND the crystal. Your clock problem is likely due to noise coupling into the xtal which is also running at nanowatt power levels. I had the same problem with the same chip and the above fixed it for me. phil B wrote: > Thanks, > > I agree that SBBs suck and, like I said, I put a lot > of care into the PCB design (I know AN58 well by now) > but am hoping to resolve this wierd drift thing before > committing to solder. I'd like to build it just once. > I'm probably being just a little too AR about this > but you dont get perfect by accepting good enough. Make sure you use a conformal coating on a scrupulously CLEAN board (at least around the xtal). If you want good accuracy you can also add the spec'd trim cap and tune the xtal for best rate. I assume you have the CORRECT matching crystal (6pf IIRC) and that it's being driven at the correct power level (different styles require different drives). > I wonder if humidity might be a culprit with the SBB > changing capacitance and thus affecting the crystal > frequency. Possibly, since you have quite a large area of conductive spring wings that are coupled to plastic with an air gap. > This is part of a vehicle presence sensor monitor. > I'll be using it to trigger a number of actions > including a camera and logging the event time so And what about the camera real time clock (if its a consumer digital camera)? > reasonable accuracy is important. I'll probably have > to regularly set the time in the RTC. Not if you implement a correction factor in software. Once you know the bias and temperature drifts, you can adjust the displayed time accordingly or log the offset when you discover an event has occurred, and project the drift backwards to get the exact time. Of course it would be best if the xtal were close to correct value. How are you putting the date/time into the video (I assume) stream? Robert > --- Paul Hutchinson wrote: > >>The crystal inputs of Dallas RTC chips have an >>extremely high impedance >>(~10^9 ohms). IME, a solderless breadboard is >>definitely not suitable for >>this circuit. >> >>Dallas Application Note 58 "Crystal Considerations >>with Dallas Real Time >>Clocks" has very good troubleshooting and PCB layout >>information. >> >>Paul >> >> >>>-----Original Message----- >>>From: piclist-bounces@mit.edu On Behalf Of phil B >>>Sent: Sunday, May 08, 2005 7:19 PM >>> >>>OK, I'll try it again. Sync up == check atomic >> >>clock. >> >>> PC clock is then *very* close to atomic clock >> >>(like >> >>>milliseconds). sheesh, maybe some one else has an >>>idea. >>> >>>Restatement of problem with omission of anything >> >>to do >> >>>with PC: >>> >>>I have a Maxim/Dallas DS1302 RTC and supposed 20 >> >>PPM >> >>>crystal (32768 hz). It seems to work ok but I'm >>>seeing some fairly odd drift with it. I compare >> >>it >> >>>against an atomic clock every day. >>> >>>What I'm seeing is that the DS1302 is not off by >>>a constant amount but drifts around by as much as >> >>30 >> >>>seconds + or - in a day. That is to say one day >> >>the >> >>>RTC will be ahead by 20-30 seconds and the next >> >>day it >> >>>will be behind by some amount. The room that its >> >>in >> >>>stays within 5 degrees F and I haven't gotten >>>physically near (2-3 ft) the circuit in question >> >>(I'm >> >>>using a PIC to send the time via serial I/O). The >>>circuit is in a solderless breadboard so I know >> >>there >> >>>is extra capacitance probably slowing the crystal >>>down. >>> >>>So, I would have though under those circumstances, >> >>the >> >>>RTC would be off by a relatively fixed percentage. >> >> Is >> >>>this just a case of the solderless BB causing >> >>problems >> >>>or is there something else going on? something >> >>that I >> >>>might compensate for? >>> >>>The PCB its going into has ground rings on both >> >>sides >> >>>of the board for the crystal, I've routed signals >> >>away >> >>>from the RTC in general and the crystal in >> >>particular >> >>>and have lots of grounded copper areas. >>> >>>Phil Barrett -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist