You are here

Multiple Timer interrupt | Cypress Semiconductor

Multiple Timer interrupt

Summary: 4 Replies, Latest post by hli on 23 Nov 2016 06:35 AM PST
Verified Answers: 1
Last post
Log in to post new comments.
creative's picture
User
43 posts

hi,

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

user_1377889's picture
User
9596 posts

or

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

Call your interrupt handler when zero, same for %7

 

Bob

creative's picture
User
43 posts

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?.

user_1377889's picture
User
9596 posts

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

 

Bob

hli
user_78878863's picture
User
2575 posts

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.

Log in to post new comments.