- Sat Sep 17, 2016 4:18 pm
#191723
Hello everyone,
In one of my project, I am using interrupt and my microcontroller is Arduino Pro mini (5V, 16MHz) ATMega328. I am using both interrupts. Under each interrupt I am calling a function like following:
detachInterrupt(0);
A_SIG=1;
B_SIG=digitalRead(PinB); // PinB is another interrupt pin
if(B_SIG==0){
pulses++;
}
if(B_SIG==1){
pulses--;
}
attachInterrupt(0,A_FALL, FALLING);
I am interested if I can find how much time microcontroller will take to execute this part of the program. Because I have a feeling while executing this part of the program another interrupt happens and micrcontroller can not detect it. So, basically missing interrupts.
Thanks in advance if you can help.
In one of my project, I am using interrupt and my microcontroller is Arduino Pro mini (5V, 16MHz) ATMega328. I am using both interrupts. Under each interrupt I am calling a function like following:
detachInterrupt(0);
A_SIG=1;
B_SIG=digitalRead(PinB); // PinB is another interrupt pin
if(B_SIG==0){
pulses++;
}
if(B_SIG==1){
pulses--;
}
attachInterrupt(0,A_FALL, FALLING);
I am interested if I can find how much time microcontroller will take to execute this part of the program. Because I have a feeling while executing this part of the program another interrupt happens and micrcontroller can not detect it. So, basically missing interrupts.
Thanks in advance if you can help.