Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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 ........:confused:
 
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top