wjwong WROTE:i thinking of doing 60s delay and looping 6o times is that possible? RTC is a burden to add on to my project instead i choose timer 555 and decade counter as hardware control.
60s Delay with PIC16F877A 20MHz
is there any example for delay program and looping?
It's not so easy and not accurate to generate 60 second pulses using 555 timer. You may generate shorter duration pulses and further divide them down using counters like 4020, 4040 or 4060 (dont need 555 as there is a built in osc). You can even cascade the 4040 to make longer chain of dividers to finally get 3600 second pulse. connect the out put to one of the RB ports (IIRC) which has edge trigger function. It can trigger an interrupt when it senses H-L or L-H edge.
Or just set up the 555 to generate 1 second pulse and connect it to RB0. On every pulse let there be an interrupt (has to setup the SFR properly). Set up two counters (CountH and countL)to increment the pulses in the ISR() till it reaches 3600 then set the variable One_Hour_Flag high. Your main routine would poll this flag to see if time is up to start up your project.
Or you can even do the above without the 555 timer. Just use the 16-bit TMR1 inside the PIC. Refer to this link to see how to do it
viewtopic.php?f=21&t=10676&p=13420&hilit=interrupt#p13420Allen