Pages: [1]   Go Down
Author Topic: Interrupt execution method  (Read 336 times)
0 Members and 1 Guest are viewing this topic.
Bangalore,India
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again smiley

I using a 328p to read two sensor inputs connected to interrupts. The controller takes in about 6000 pulses a second, roughly 6Hz on both interrupts. The interrupt triggers a flag value, but they don't trigger the same value, for ex if sense1() and sense2() are the functions, they don't change the flag x together, it's x and y separately.
My question is, there are times when both inputs are fired together, or are rendered HIGH together.
Do they still successfully run the function, or will some kind of conflict arise since two interrupts are fired together ?

Thanks smiley
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If two interrupts are pending at the same time, the mcu will service the one with highest priority. When that ISR has completed, if the other interrupt is still pending (that is, the reason for the interrupt hasn't gone away), then it will service the other one. So both will get serviced.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Bangalore,India
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's good to know.
Thanks.
Logged

malaysia
Offline Offline
Full Member
***
Karma: 1
Posts: 101
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey use this link its very usefull for using interrupt.
http://www.gammon.com.au/forum/?id=11488
Logged

dut eden rockes

Pages: [1]   Go Up
Jump to: