Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

hi,

   

How to implement interrupts at regular interval of 1msec,5msec and 7msec using a single timer?

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

or

   

Use a 1ms interrupt, Increment a counter and check for (Counter % 5) == 0

   

Call your interrupt handler when zero, same for %7

   

 

   

Bob

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

or

   

Use a 1ms interrupt, Increment a counter and check for (Counter % 5) == 0

   

Call your interrupt handler when zero, same for %7

   

 

   

Bob

0 Likes
Anonymous
Not applicable

thanks bob,

   

But what i need is to have seperate ISRs. And 5msec interrupt will have more priority than 1 msec one.

   

Do i have to use control registers or is there any other option?.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Under that premises you will need 3 individual timers, although I (personally) would do that in software.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The priority can be handled in software too (just check for timestamp%7 first).

   

Having separate timers makes it more difficult to have them synchronized.

0 Likes