- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
How to implement interrupts at regular interval of 1msec,5msec and 7msec using a single timer?
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or
Use a 1ms interrupt, Increment a counter and check for (Counter % 5) == 0
Call your interrupt handler when zero, same for %7
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or
Use a 1ms interrupt, Increment a counter and check for (Counter % 5) == 0
Call your interrupt handler when zero, same for %7
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Under that premises you will need 3 individual timers, although I (personally) would do that in software.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.