Something reminds me to a problem, that is ICD2 reads a register (aka you are put it into the watch window) then it could ruin things like this. For example if you read RCREG then RCIF clears, so if you put RCREG into watch window then it could kill the RCIF flag. Not sure if i recall te problem well. Tamas On Sat, Aug 2, 2008 at 4:39 PM, Wojciech Zabolotny wrote: > WH Tan wrote: > > > I see you have experienced some problem with PIC interrupt - from > > initially USART to now external INT. Have you considered to > > experiment with a timer interrupt instead? I think a timer is more > > easier to set up since it doesn't depend on external event. And it > > much more simple to test it in MPLAB SIM. > > I have tested my code in MPLAB SIM (under wine), and found it working. > > After some googling about PIC and interrupts problems, I have found > the following: > http://www.motherboardpoint.com/t93255-interrupt-not-firing-on-pic18f.html > > I checked that in my code (based on the Bradley Minch's USB firmware) I had > the _DEBUG_ON_4L option set. After I replaced it with _DEBUG_OFF_4L, > the interrupts > started to work! > > I'm quite surprised, that setting of this option breaks interrupts... > In the datasheet (39632D.pdf) there is nothing about it... > -- > Regards, Wojtek > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Rudonix DoubleSaver http://www.rudonix.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist