Hello All,
I am trying to figure out how best to write a sequential code execution monitoring diagnostic for my 8051 project. I want to be able to prove that the code execution has hit all of my 8 tasks before resetting the watchdog timer.
Each task is done at 1.25msec time intervals, they must happen in order, and it takes all 8 to complete the sequence.
It seems like there might be a way to encode a single byte that's end value proves I went through all 8 states and in the right order.
My first instinct is to simply advance a counter, but that can be fooled if stuck in the same task the right number of times. Maybe if I folded in an 8-bit CRC to a register?
Any suggestions are appreciated. (except for the condesending type)
Set a bit in a byte for each task (you have 8) when the number is 0xFF (255) each task has been completed.
That's the simplest method I can think of (you can tell which task is not completed also). Each task sets the bit. When the watch dog is kicked you reset the byte.
Stephen
Not sure why I couldn't think of that!
Thanks!
View all questions in Keil forum