chipKIT® Development Platform

Inspired by Arduino™

Disabling all interrupts (also the core timer ISR which powe

Created Mon, 22 Oct 2012 22:42:40 +0000 by educa


educa

Mon, 22 Oct 2012 22:42:40 +0000

Hello,

I tried the following line in my code

noInterrupts();

or

INTDisableInterrupts();

I thought that that would disable ALL interrupts on my chipkit. With all interrupts, I also thought that that would be the coretimer ISR which updates the millis() value.

But.... when I run very high speed code, then I clearly see that every millisecond I get a hickup in my code execution (not much, but visible on logic analyzer) + if I use the millis() function with nointerrupts(); active, then I still do get milliseconds returned and they are correct.

Is this the wrong way for me to shut down all interrupts ? How should I do it then ?

Kind regards,

Bart


EmbeddedMan

Tue, 23 Oct 2012 00:00:20 +0000

Both noInterrupts() and INTDsiableInterrupts() do the same thing - completely dsable interrupts.

If you leave interrupts completely disabled, I just don't see how the result from millis() could be correct.

However, if you re-enable them, then the millis() code will correctly catch up the current millis() value (based upon the always-counting CoreTimer) so that it is correct.

Cool, no?

*Brian