For those guys who followed my story on the interrupt problems I had, here's the next chapter. After a few mails to the piclist and some great help I came up with the next piece of code. void __INT(void) { if(PIR1.SSPIF) { PIR1.SSPIF = FALSE; // Clear I2C interrupt flag INTCON.GIE = FALSE; // Global interrupt enabled save_context; I2C_InterruptServiceRoutine(); // decode I2C message Transmit or receive restore_context; INTCON.GIE = TRUE; // Global interrupt enabled } else if(PIR1.CCP1IF) { PIR1.CCP1IF = FALSE; // Clear compare interrupt flag INTCON.GIE = FALSE; // Global interrupt disabled save_context; if (DBS_LaserMode == LAS_MAIN_ON_STATE) // switch of/on pulse generation { LaserFreqOut = ~LaserFreqOut; // PULSE GENERATION } restore_context; INTCON.GIE = TRUE; // Global interrupt enabled } else if(INTCON.T0IF) { INTCON.T0IF = FALSE; INTCON.GIE = FALSE; // Global interrupt disabled save_context; TMR_InterruptServiceRoutine(); // SYSTEM TIMER restore_context; INTCON.GIE = TRUE; // Global interrupt enabled } return; } The problem now is that I receive a Stack overflow error from Mplab when the timer is generating very fast interrupts, generating pulses from 2kHz works fine. Once I increase the value the Stack overflow error is displayed Frank Temmerman __________________________________________________________________ One fool can ask more questions than all the scientists in teh world can answer __________________________________________________________________