number preloaded into timer (PIC18)

Thread Starter

TheRekz

Joined Oct 25, 2009
13
If I want a timer with a period of 1 second
The external oscillator is 8 MHZ
The prescaler is set to 128


What number should be preloaded into the timer? I remember there is a formula to do this, but I can't find it... can anyone help me
 

beenthere

Joined Apr 20, 2004
15,819
For a digital clock that runs with an line operated supply, you can arrange to use part of the AC waveform to produce a 60 Hz waveform. If you apply that signal to a counter, one second will have elapsed every time the count reaches 60.

A 60 Hz waveform goes through 60 repetitions in one second. An 8 MHz waveform goes through 8,000,000 repetitions in one second. Frequency is always cycles (or repetitions) per second.
 
Top