View previous topic :: View next topic |
Author |
Message |
supermax
Joined: 27 Nov 2004 Posts: 1
|
1 hz clock |
Posted: Sat Nov 27, 2004 7:52 am |
|
|
How can i obtain a 1 hz clock with a 16f628, only using timer and interrupt? I can't use delay because this clock is to synchronise others operations.
Thanks
Max |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sat Nov 27, 2004 11:31 am |
|
|
And you would be driving the PIC with what?
How accurate? |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Sat Nov 27, 2004 4:10 pm |
|
|
Configure Timer1 as a counter, with a 32.768KHz crystal. This way you can create 1Hz interrupts. |
|
|
future
Joined: 14 May 2004 Posts: 330
|
|
Posted: Sat Nov 27, 2004 4:14 pm |
|
|
Configure a 100uSec timer, divide by 10 to obtain 1ms, by 100 and get 100mS and by 10 again to obtain 1S.
You can have many timings. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sun Nov 28, 2004 9:31 am |
|
|
Search this forum for "Real Time Clock" or 'RTC' and you will find many examples. |
|
|
|