Byron A Jeff wrote: > On Fri, Feb 23, 2007 at 01:16:22PM -0800, picnoob wrote: > >> ok, i am doing a new project, u guessed it...a clock. >> > > Been there. Done that. Got the tee shirt. > Get the DVD, too? > >> now, i have read some guides about this on the www, but the give >> different >> info. Is it true that the frequency of the oscillator used is >> divided by 4, >> and instructions are executed at this new frequency? >> > > That's true for PICs. > > >> im using a pic16f84a. >> > > What exactly is this clock supposed to do? There's probably better > choices than the 16F84 if you want to perform this activity. One > reason is that other PICs have multiple timers. In particular 16F > PICS with timer 1 can be driven from an external oscillator independant > of the PIC oscillator > > >> also, i wanted to know, what is different between 16f and 16c etc....? >> > > Marketing. Nothing really worth talking about. > > I'd advise you take a read on newer PICs if PIC are where you are > planning to work. I've argued over the years that the 16F84 limitations > makes getting tasks done difficult. > > Finally just so you won't go away empty handed you can take a look > at my code for my sunrise/sunset outdoor light controller, which is > basically a calendar/clock that turns outdoor lights on about dusk > and off around dawn. Code is here: > > http://www.finitesite.com/d3jsys/clock.asm > It's written for a 16F877 and drives timer 1 with a 32 khZ watch > crystal to generate a 2 second counter. > > Accuracy is a bit problematic. Crystals will vary in oscillation > rates based on temperature. I always planned to update the project > to use the 60 Hz power line signal, but just never got back to it. > > Hope this helps, > > BAJ > If you want a clock that is ALWAYS accurate to a second or two, you might consider using WWVB (if you are in the US/CA at 60Khz), DCF77 (Germany at 77.5Khz), HGB (switzerland at 75Khz), MSF60 (UK at 60Khz), or two Japanese transmitters, one at 40Khz and the second at 60Khz. They provide worldwide coverage. Tests indicate that WWVB reaches well into South America, for exanple, and Japanese signals reach Australia easily. C-MAX sells modules that will extract the time information, or even smaller modules that act as receivers only, and you can extract the time code. I am designing a solar tracking system that uses accurate time and a known position to determine where the sun is at all times. The tracking math has all been solved, but an accurate time source was undetermined. I have now concluded that the above time service is cheaper and more reliable than GPS, as GPS requires an expensive antenna & GPS receiver, at about $90 USD, while this module and antenna in a plastic box costs less than $10 USD. For reliability, I only use WWVB once a day in the middle of the night to SET the time, and a separate timekeeping chip maintains it during the day. So, funnel this time data into your clock once a day to re-calibrate the clock. --Bob -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist