Microcontroller › PIC › PIC18f4520 Timer Interrupt › The basic idea is that the
May 6, 2012 at 6:17 pm
#7601
AJISH ALFRED
Participant
The basic idea is that the timer is a nothing but a counter which will generate an interrupt when it overflows, and the which increments its count each time a pulse received at the timer module. That pulse is derived from your main clock source, ie a the frequency of the clock will be a fraction of the main clock frequency, usually mainclock/4.
You know the main clock frequency, divide it by four, find the number of clocks/counts required. Subtrsct that number from the maximum count possible, and set that count value as base count