Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

How to make 31-days long delay using 16F84A?

Status
Not open for further replies.

hassan1980

Full Member level 4
Joined
Jan 14, 2005
Messages
204
Helped
9
Reputation
18
Reaction score
6
Trophy points
1,298
Activity points
1,348
How to make 31 days delay, using 16F84A?

Please Help me.
 

respected

Newbie level 6
Joined
Oct 19, 2005
Messages
14
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,442
Re: Delay with 16F84a

you have real time chip (maxim)
 

VVV

Advanced Member level 5
Joined
Nov 26, 2004
Messages
1,582
Helped
383
Reputation
766
Reaction score
86
Trophy points
1,328
Activity points
19,971
Re: Delay with 16F84a

Simply create more "counters", that is file registers that get decremented.
For example, if your clock is 32.768kHz and if you use TMR0 with a prescaler of 32, then it will overflow in:32768/4/32/256= 1 second. That is, every time TMR0 overflows you know that a second has elapsed
Every time it overflows, you decrement a counter (initialized with a certain number). For instance, if you initialize that register to 60, then every time it reaches zero you know a minute has elapsed. Then, whenever this counter reaches zero, you decrement another counter, which counts minutes. When 60 minutes have elapsed, you have 1 hour.
And so on, up to 31 days.

For a different crystal frequency, you just need to adjust the first counters to obtain the second, if you wish.

Another way of doing it is to simply calculate the number of instruction cycles in the period you need and just use binary counters, if you do not care about seconds and minutes.
 

Davood Amerion

Advanced Member level 2
Joined
Mar 1, 2005
Messages
584
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,351
Delay with 16F84a

you can use real time clock RTC (chip) such as DS1307 or PCF8583.
in this case your timer will work even when power lost.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top