longpole001
- 22nd July 2012, 13:47
Hi guys ,
can you advise a ways to read a timer who's' interrupt flag will likely appear while its doing other things before it can find time to read it to check it
code is using 8bit timer 2 , with a preload of 250, = 250*16pre*15post *5uS=300mS ( 5us clock when 8Mhz)
i start the timer
then going to do a routine that takes about 1 sec to complete and then check the flag , but since timer is only 300ms , its missed it , so way out
only way i know is to somehow go check the flag after time frame of less than 300ms , but the routines it calls are not always as predictable to the 300ms time frame to check and will be likely missed
any suggestions or code ref on how to approach this problem
cheers
Sheldon
can you advise a ways to read a timer who's' interrupt flag will likely appear while its doing other things before it can find time to read it to check it
code is using 8bit timer 2 , with a preload of 250, = 250*16pre*15post *5uS=300mS ( 5us clock when 8Mhz)
i start the timer
then going to do a routine that takes about 1 sec to complete and then check the flag , but since timer is only 300ms , its missed it , so way out
only way i know is to somehow go check the flag after time frame of less than 300ms , but the routines it calls are not always as predictable to the 300ms time frame to check and will be likely missed
any suggestions or code ref on how to approach this problem
cheers
Sheldon