Can i use the TIMER1 for timer ckt

Status
Not open for further replies.

sachin.kolkar

New Member
hello friends ,
my project is timer ckt for fan control.
can i use the TIMER1 form the PIC16F72. 20th may is the deadline for the project ...........after 10 min ckt generate some signal to operate the relay..
Plz help me ........
 
20 minutes you say or was that 30 - 10 of may? Seriously, the use of TIMER1 cannot be the hold up of the project.

Set the timer to its max number of cycles. Compute or better yet measure with an o-scope the length of this max_cycle. Then take 60 seconds / max_cycle * cycle_time. This returns your 1-minute BASE. Now every time the timer interrupt is triggered, the BASE, which may be two 8-bit variables, is decremented by 1. Over time the BASE will reach 0 afterwhich you proceed to decrement another variable called MINUTES but only after your reset your BASE variables. Finally after the MINUTES variable decrements down to 0, branch, call, or vector to a routine to generate the famed elusive relay operating signals.

But... of course the real work is in the setup. Gota set global interrupts, gota set timer1 interrupt, gota clear timer1 flag before all this, gota load the timer, and gota turn on the timer, and gota setup an interrupt vector address, gota clear timer flag again while in the interrupt....
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…