According to my thread "Do an evil ghost live in my PIC18FxxJxx ? - using CCS compiler" started 2007-08-27, we are now trying Microchip C18 Unfortunatelky the target system is completely unable to run with the similar ported code, due to that C18 decides to save over context save/restore 40 registers each interrupt, and most of them using time-wasting loop instead of a bunch inline MOVFF !! Due to spending most of the time in context save/restore the program fail to handle timer interrupts and external events. http://forum.microchip.com/tm.aspx?m=279936 Accordign to an answer in that thread it is impossible to make C18 create time-efficient (non-looping) context save/restore. My collegue is now rewriting and making duplicate functions for use in interrupts and outside, but it is a lot of work and pretty ugly. Is there some other option maybe? Can we somehow make it use three different scratch areas for main and the two interrupt levels, so it do not need to save/restore all? Other ideas? Using CCS we did not have this problem, but it also demanded we use separate functions inside interrupts. -but we had some problem with the code not working reliably and could not find out why so we try changing compiler... We also have the option to change to Hitec PICC18... How do that compare... Do PICC18 handle interrupt save/restore efficiently? The seem to mostly boast compact code, but we have lots of free space; for us speed is most important, especially jumping in and out of interrupts. -- Morgan Olsson -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist