Hi, I am having a while(1){} loop and all interrupt disabled. It loops for a while and then gets out of the loop, jumping to a random address (not interrupt vectors) or break of out the loop and continues sequentially from there. Is there anyway to detect a bad instruction fetch? In other microcontroller, a bad instruction would branch to an interrupt vector. Thanks, Anh
Is there anyway to detect a bad instruction fetch? In other microcontroller, a bad instruction would branch to an interrupt vector. I doubt this is a bad instruction fetch, I think it is an incorrect instruction fetch. There is only one opcode in the '51 that is "bad". If, instead of the jmp back the fetch is add, the program will, of course, go astray. My guess is that you are using external code memory that is just a itty bitty tad too slow. That would work in some high percentage of the time. Another possibility is brownout detect. Erik