Kenneth Lumia wrote: >> There are several parts >> >> Timebase >> Timekeeping >> Alarms >> Interface >> >> Timebase is the "tick" of your calendar. This can be from an >> external source, such as mains cycles, oscillator or IC. The >> gif I posted shows a 0.5Hz output but an alternating 0.5Hz >> is available at the other output pin -> 1Hz if you use both. >> If you want a less fine resolution, you can divide this down >> with 4040(s) to get 1 pulse per minute or hour or day >> > > Easiest is a 32.768kHz crystal connected to T1 osc pins. If > you select the appropriate divide downs in timer1, you can > get a very accurate interrupt. If that is not an option, you could > use Timer0 and divide the system clock down. This is not > as nice, as the binary divide down typically does not work > out to a 10 mS multiple. In this case you must preset the > counter each interrupt, instead of allowing it to simply rollover > as in the 32.768kHz case. This causes some error as the > timing is not consistent (depends on what else is going on) > and that every write to the counter causes the prescaler to be > cleared. You will need to provide some sort of clock adjustment > in the code. > > [snip] > > Ken > Obviously (or not), you can also choose a convenient crystal for your system. I have a project with a 6.5536MHz crystal (with 4xPLL) that is perfect for generating 10ms interrupts on timer Rollover (I use this for timing the shutter-release on a camera to 1/100th of a second...). Other convenient crystals.... 4.19304MHz (no PLL, and 16prescale, or PLL with 64 prescale) gives 1 interrupt per second, or, if you have a flashing segment to indicate "ticks", it is really easy to get 2 interrupts per second and thus get a flash-on,flash-off sequence. You can do the math for other frequency crystals.... there are a number of convenient ones. I consider this to be easier than the 32.768 option because it is fewer parts. Power saving opportunities are less though. Rolf -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist