Step 4Time Keeping
( http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011057 )
The clock is simple and elegant. A 32.768kHz watch crystal is connected to the timer1 oscillator pins of the PIC. Timer1 is great for this because it can increment even while the PIC is sleeping. Timer1 is setup to count to 65536 (2 seconds at 32.768kHz) and wake the PIC from sleep with an interrupt. When the PIC wakes, it increments time by two seconds. The PIC is only active and consuming power for a brief time every few seconds.
I used a cheap quartz watch crystal from Citizen. I though the Citizen name might give my watch legitimacy. The CFS206 (12.5pf) has about +/- 1.7 minutes accuracy per year (20ppm). Two 33pF capacitors complete the external crystal circuit. 33pF is probably a tad much, but it was available locally at a reasonable price. A better crystal could be used for more accurate time.
Crystal: Citizen KHz Range Crystals, 32.768 KHZ 12.5pF, (mouser #695-CFS206-327KFB , $0.30).
Capacitors: 2x33pF, 1206 SMD.
| « Previous Step | Download PDFView All Steps | Next Step » |
1
comment
|
Add Comment
|
![]() |
Add Comment
|

















































