i know that i'm a greenhorn, which could cause a very simple solution for my problem. but i can't find any solution
problem:
a led should be on for exactly 1000ms (delay_ms(1000)).
but the pin is high for about 1136ms when i use the rtcc (timer0 function with interrupts are necessary for the projekt).
/*****************************> T I M E R 0 aktivieren <*****************************/
int_zaehler=ints_per_zehntelsekunde;
set_timer0(0);
setup_counters(RTCC_INTERNAL,RTCC_DIV_2);
enable_interrupts(INT_RTCC);
enable_interrupts(global);
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
Posted: Fri Dec 03, 2004 5:47 am
The delay_ms function doesn't account for time spent in an interrupt. So during that 1000ms your interrupt took up 136ms. You could setup a timer to count some unit of measurement (I like to use ms). Then do something like
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum