Hi,
I have been trying to get my head around how to use timers and counters but I cant figure out what this example is saying. Heres one example
Q1 - For TIMER1_isr(), Can someone tell what the comments are saying? I understand the comment //interrupt occurs every second and even then I cant see what makes the interrupt every second
Q2 - What is happening in main()?
I have been trying to get my head around how to use timers and counters but I cant figure out what this example is saying. Heres one example
Rich (BB code):
#include <16F877.h>
#use delay(clock=lOOOOOOO)
#fuses HS,NOWDT
int outs;
#int_TIMERl
TIMERl_isr()
{
}
outs = outs A Oxl;
output_bit(PIN_D7, outs);
void main()
{
//interrupt occurs every 2 seconds
//toggle output bit
//replace this line with code to keep
II track of seconds, minutes, hours, days,
//etc. to implement a real clock.
setup_timer_l(Tl_EXTERNALITl_DIV_BY_1IOx8);
}
Q2 - What is happening in main()?