You probably already know this, but - Be especially aware of non atomic operations in shared registers (such as interrupt flag registers and ports/lats). If the operation isn't atomic, and interrupted by a routine that also manipulates the same register, a change can get undone when the interrupted routine writes back the value to the register. Sort of a sofware read-modify-write problem. The results you are getting could for instance be caused by a CS signal being changed for an SPI channel during communication.
This is more of a problem with PIC32 though, since operations such as REGISTERbits.BIT=value isn't atomic but on all other PICs they are.
Good luck and let us know what you find.
/Ruben
This is more of a problem with PIC32 though, since operations such as REGISTERbits.BIT=value isn't atomic but on all other PICs they are.
Good luck and let us know what you find.
/Ruben