I'm wondering if anyone else has come across strange behaviour sometimes when using local function variables with HiTech's PIC C compiler (latest version - 8.05PL2, and also 8.03PL3)? The contents of temporary local variables in some of my functions are getting overwritten without reason. By changing them to static it fixes the problem. I'm having to allocate a lot of the other variables in 3 of the banks, so I'm wondering if that is a cause? I've turned off all optimization and it still happens. At no point does any of my code write to an address in RAM except via a pointer to a variable, so I can't see how these variables are getting overwritten. What makes it so much harder to track down is that it doesn't happen in the MPLAB similuator but only when I program the PIC, of course! ;) So I'm debugging with a scope and some diagnostic pin output... I've been using this compiler for a couple of years without this trouble before, but with this code it's happening all over the place. I've never targeted this PIC (16F876A) before, but I doubbt that's central to it. I could raise this on HiTech's forum but that gets little traffic. I'm really looking for any experiences from people here that could backup or otherwise what I think I'm seeing! Many thanks. James -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist