>>As the hours pass i think more and more Proteus has a bug inside I thought you texted this on a PIC.. its probably that.. something to do with vsm.. I cant see anything wrong with your code exept with volatile.. I have not used proteus.. but from their site it seams its designed to be used with code from its own basic compiler... maybe it was not meant to load hex files from other compilers.. I had similar problem with PIC simulator IDE.. when loaded with a hex file from other compiler the Timer interruppts does not kick in... even though the hex file works with a real PIC... "Dumitru Stama" wrote in message news:535228237.20061206001704@mirosat.com... > HH> I'm leaning towards the volatile specifier on variables, so the > compiler > HH> doesn't assume the variable is in a register in mainline code when the > HH> interrupt routine is changing it in RAM. Also, as I recall, the > interrupt > HH> was changing a multi-byte variable that was then being evaluated by > the > HH> main line code. Perhaps part way through the evaluation in mainline > code > HH> the interrupt changes the variable. Perhaps you can disable interrupts > HH> before the evaluation, then enable them after, or disable them, copy > to a > HH> local variable, enable interrupts, then evaluate the local. > HH> Harold > > I tried with no optimizations even though my C18 version expired and > it is not optimizing as it should. It produces the same effect inside > VSM. As the hours pass i think more and more Proteus has a bug inside > its emulation software. Today it was a bad day for experimenting but i > will try it for sure tommorow with real components and real PIC > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist