jhanus
New Member
Hello,
How to clear call Stack and write to it?
For example after interrupt execution it goes where I want it to go(beginning of the main loop), address where interrupt should return is deleted and all other on stack are cleared but a new one, user defined is put on stack, so when interrupt is done, it goes where I want it to go. As when PIC would start from "clean state" after reset or if he was just turned on.
I also could redirect with GOTO, ie 0x0040(start of main loop), but problem remains - the stack, there would be addresses which are not valid any more, of course if everything would be ok, this would be "the new" starting point, stack has depth of 31, but this device will remain active for who knows how long and there can't be this kind of errors.
I need to do this, because I have 6 different I2C devices, I don't have proper equipment to debug, neither do I have any more will to torture myself. If he hangs in some infinite loop this will bring him back on track, in combination with manual I2C release/reset.
Just for information, this "lock up" happens once, always random in between 45min - 3h.
Watchdog is not an option, because just to build main menu on 240x128 GLCD he needs 5s...
Using: 18F4550, C18
Thanks
How to clear call Stack and write to it?
For example after interrupt execution it goes where I want it to go(beginning of the main loop), address where interrupt should return is deleted and all other on stack are cleared but a new one, user defined is put on stack, so when interrupt is done, it goes where I want it to go. As when PIC would start from "clean state" after reset or if he was just turned on.
I also could redirect with GOTO, ie 0x0040(start of main loop), but problem remains - the stack, there would be addresses which are not valid any more, of course if everything would be ok, this would be "the new" starting point, stack has depth of 31, but this device will remain active for who knows how long and there can't be this kind of errors.
I need to do this, because I have 6 different I2C devices, I don't have proper equipment to debug, neither do I have any more will to torture myself. If he hangs in some infinite loop this will bring him back on track, in combination with manual I2C release/reset.
Just for information, this "lock up" happens once, always random in between 45min - 3h.
Watchdog is not an option, because just to build main menu on 240x128 GLCD he needs 5s...
Using: 18F4550, C18
Thanks