Marcel van Lieshout wrote... >I have a routine as part of my main loop which does some math on 32bit >integers. The integervalues are stored into the variables by the >interrupt-routine. It can happen, of course, that my main routine is >fetching the values while the interruptroutine is storing new values into >the variables. This overlap would be at least 8 cycles (fetch four >bytes/store four bytes). Is it possible to hold off interrupt processing >for, let's say, a dozen cycles? Are there any other failproof solutions? As others have suggested, you can disable interrupts while you are accessing the variables. But if interrupt latency is an issue, you can use a different method: have the ISR put the 32-bit integer into a temporary holding register and set a flag bit somewhere to indicate to the main code that a new integer value is available. The main code can test the flag and when a new value is available, transfer it to the working variable and then reset the flag. The ISR, in turn, refrains from updating the holding register unless the flag has been cleared by the main code. Dave D. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.