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.

delay for ISR to activated

Status
Not open for further replies.

faysal_002299

New Member
Hello all,
I am a newbie and I have a very simple thing to know. Please help me.


I am using an external interrupt routine for doing a certain task. For example when the interrupt is activated, the MCU sends some information to the host PC- it's quite simple. Now I want to modify this in a way so that, the MCU will send that information to the PC after 1 second of getting the interrupt signal. How can I implement that in the ISR? Any code example would be really helpful for me.



with Thanks
 
In your ISR, when the external interrupt happens start a timer and when the timer interrupt happens send the data.

You don't state which MCU or language and so example code is rather difficult to provide.

<edit>I posted example code in this thread showing how to do both an external and timer interrupt at the same time.</edit>

Mike.
 
Last edited:
Sorry...I forgot

I am using dsPIC30F3011

According to you it will be somewhat like this I this-
T1CONbits.TON = 1;

But the problem is I don't want to use timer as I have to use the timer for other purposes. Please suggest me an alternative

Thanks a lot for your quick responce
 
Don't the DSpics have 3 16bit timers? You should be able to use one to provide a tick clock of say 10mS and use that to do the ISR delay as well as any other delays you may require. Look at the example I posted earlier and see if it makes sense.

Mike.
 
Dear Mike thanks again.

Ya dsPIC has 3 timers. But I have to do this thing in six external interrupts. Furthermore, I am using 2 out of these 3 timers in the Input capture ISR for calculating pulsewidth of pwm. So I have no way to use timers for this operation.
 
Why can't you use the spare timer to generate a 10mS interrupt and have counters for the 6 inputs? If you can't do that then you need to explain in more detail what you are trying to do.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top