Setup a timer as a counter with an external clock input T*CKI pin. Then you just need to reset the counter to 0 and after 3.6 sec you stop the counter and read the value when you have time for it.
How to know 3.6 seconds have passed is an other problem. Maybe you already have a timer running as RTC or you set up a timer to overflow after 3.6 sec. When the 3.6 s timer overflows you get an interupt and then you disable the counter clock input. If you set a flag in the 3.6 s timer interupt you can easily know that you have new valid data to be read from the counter register.




Bookmarks