P2 Taqoz V2.8 Watchdog with Serial Output of Return Chain and Stack - Example for Timer Interrupt
Hi, this might perhaps be useful for others, groping because of mysterious trouble.
It uses absolute addresses of serial routines and cog, so they are fix here for the version! **So this will only work with the version _BOOT_P2.BIX in Taqoz.zip in https://sourceforge.net/projects/tachyon-forth/files/TAQOZ/binaries/ .
The assembler routines from TRACE are used here, so it should work, even, if the Forth system is defective.
It is meant for cog0.
What does it do?
"startIsr" establishes an interrupt service routine "isrWatch".
"isrWatch" will be called regularly, defined by the long constant deltaCnt, once a second in my example. Normally this routine just adds one to the variable wdCount. But if a limit "wdLimit" is reached (5 in my example), the watchdog will output the momentary Forth call chain and stack depth and it's top 4 contents.
While in the example, we just wait for the watchdog to chime in, normally some routine should "0 wdCount !" to prevent this.
Have fun and I wish you, that you never need it!