using interrupts

kieran_akers

New Member
when you use the interrupt feature, is there a way of getting the interrupt to set off 2 seperate lines of code (not necessarily in sync). so for instance, if the interrupt was activated through pin0 becoming high could you the set pin3 high and run a seperate line of code at the same time?
 

hippy

Ex-Staff (retired)
You can do whatever you want within the interrupt routine, but there can only be one interrupt routine and code within it can only be run sequentially.

If you need to do two things in response to an interrupt, they can usually both be done within that single interrupt routine. If you need to do different things, it should be possible to use a variable to indicate what the interrupt routine should do when an interrupt occurs.

I'm not entirely clear as to how you mean by doing two separate things, or the circumstances in which you would need that.

"At the same time", is a somewhat open-ended matter, even a PC CPU seemingly running a number of applications simultaneously only really does one thing at a time.
 

kieran_akers

New Member
cheers for that, ive managed to re write the code as i was attacking it the wrong way. i couldnt get it to inyterrupt and do what i wanted, but that was due to the layout of the code.
 
Top