Go Down

Topic: Global Interrupt Enable and disable sei() and cli() - Due equivalents? (Read 8179 times) previous topic - next topic


Noob here....
Does anyone know if there are equivalents for this on the Due?  I assume these commands are for the Uno processor and the the Due.
Any help would be greatly appreciated.

Aurora, IL.


Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html


I've been trying those....but they just don't seem to behave the same as the sei and cli commands....


anyone else?


Been looking for the same myself, and i guess that due to the complexity of the difference in timers, and which you use, you might have to call specific stop interrupts and/or peripherals interrupts specific stop/start call commands..
10 LET Loop=Infinite
20 GO TO 10


Could you post your code, and say what you expect it to do and what it actually does? All I can say is that interrupts and noInterrupts work as expected for me.
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html


all i'm really trying to do is recreate the fan rpm app with multiple fans and lcd's.  I'm sure you've seen the original code a million times...it works fine on an uno ... but gives erroneous results (I believe) on the due.  You, apparently, need to suspend the interrupts in order to make the calculation for rpm and write to the lcds.  And, I believe, the interrupts need to be suspended in turn for each fan you are reading.  I know, from asking Noctua, that each fan pulses twice per revolution, however when I use the interrupts(), noInterrupts() commands I get results that are different than what was experienced on the uno.  The only reason I switched to the Due was in order to declare additional interrupts and thus add more fans...pumps...whatever.  The code...mine?  Nah, right now it's a hodgepodge of different things I am trying out.  I just thought if there was an equivalent to the global commands, then it might work out much in the same way between the two boards.


I believe I'm getting better results along these lines:
FanSpeed2 = 0;
    // sei(); //Enables interrupts
    delay (1000); //Wait 1 second
    Calc2 = ((FanSpeed2 * 60)/2);
   //cli(); //Disable interrupts

the resultant rpm seems more realistic...and two fans are much more similar in output.


Go Up