Hi Ken, you wrote: > ... > Every time someone criticized my engineering work, be it hardware, software, > or firmware, it has made me a much better designer. I, too, have learned to appreciate constructive criticism; and, believe me - I've had my share! - but that's not what I've had my hackles raised about! you wrote: > Are you able to pump out some registers out the serial port for debugging > purposes? > Olin gave you a hint about a possible bad coding practice -- maybe FSR > related? > Is the ISR modifying the bank select register? !!! I think I'm onto something! Due to the sporadic nature of the "failure" [which was that B1_COUNT was getting trashed], it appears that something asynchronous to the main execution thread must be the culprit. So, I went directly to the ISR with my suspicions: far as I can see, ISR is as correct as it can be... *IF* execution was interrupted from Bank 0 ! The ISR saves 'W', 'STATUS', 'FSR' etc. into temp variables that are defined in Bank 0. Now, I've not written code before that operates on Data Memory in Bank1...3. Could it possibily be that I need to 'shadow' my ISR Temp variables in each Bank? As it turns out, my "W_TEMP" variable is allocated at address 0x20 (bank 0). What is supposed to happen if, while I'm executing code that's referencing Bank 1, I get an interrupt and attempt to save "w" in "W_TEMP" (0x20)? I'm guessing that this might be the source of 0xA0 being whacked? Does this sound right to you? I did one experiment that seems to reinforce my conjecture: moved the data structure definition to be based at address 0xA1... never see any execution problems (after MANY retries!). I've got to try one more experiment: to see if the value that "clobbers" 0xA0 was in fact the "W" value being saved by the ISR. To quote "Arnold"... "I'll be back!" Jim > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body