Abdulla (and Aurangzeb), I'm as confused as Paul over your replies to this. You can easily generate delays of years with any PIC. Given a crystal oscillator, you don't even need a timer. The common method is to generate a timer interrupt at a convenient interval and use that `tick' to increment software counters as you described but you don't need external hardware. - Tom At 07:50 AM 4/28/98 +0300, Abdulla Aldossary wrote: >Paul B. Webster VK2BZC wrote: >> >> Aurangzeb Haque wrote: >> >> > You can implement a timer by simply writing a couple of nested >> > counting routines, to "spend" the CPU's time. >> >> ... >> >> > You could add sufficent number of such routines to get a desired basic >> > unit of measurement , say 1 second. You can then multiply by nesting >> > more routines. >> >> > However because of the limited resources of the PICS, please don't >> > expect to make a timer which is able to span a large period (from >> > seconds to hours). For that you would need to add external hardware. >> >> Can you explain that please? One singularly popular PIC application, >> if only as an exercise since there are plenty of clock chips purpose- >> manufactured already, is a common LED clock such as the following: >> http://hydromail.supelec-rennes.fr/rennes/se/equipe/jweiss/pic/pic.htm >> >> .. while the rather *uncommon* version is the "propellor" clock in >> either "digital": http://www.bobblick.com/bob/projects/mclock.html or >> "analog" http://www.geocities.com/siliconvalley/lab/3685/analog.htm >> versions. >> >> Cheers, >> Paul B. >paul, i believe as c programmer you can use for next loop to count for >one second, once its done increment the secound counter by one untill >seconds reaches to 60, then you increment minutes counter by one untill >minutes counter reaches 60, then increment hours counter by one untill >hours counter reaches 12 then you can change pm or am variable or >continue to increment hours to 24 then you reset the whole thing back to >zero for another day. > >you need to have seperate pic to do this job. > > > >abdulla aldossary > >dossam1e@aramco.com.sa > >