Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Timer enabling inside timer interrupt

Status
Not open for further replies.

variaseng

New Member
Hi, I want to ask if it is alright to enable a timer inside an interrupt of a timer. Basically, I want to have a conditional function inside a timer interrupt routine and I want to see if the time passed when this conditional function was accessed is greater than a certain time, for example 1 usec. For example,

1. Code enters timer1 interrupt routine.
2. Inside the routine, timer2 is enabled. I want timer2 to count until a certain PR and I want this timer2 to continue counting even after the routine is over.
3. Code exits timer1 interrupt routine.
....Timer2 continues to count.
4. Code exits timer1 interrupt routine again.
5. I check PR to see if the count (corresponding to the time passed) is greater than the PR for 1usec.

Thank you very much for your help! :)
 
Yeh there's no problem with doing that. Give it a go!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top