Log in

View Full Version : Finding time to read a timer ??



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

Jumper
- 22nd July 2012, 15:31
DT instant interupts . Search the forum and you will find tons of example code for this.

longpole001
- 23rd July 2012, 10:07
ok thanks for tht ill go look