This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HET safety issue?

Hi,

I've been working on getting PWMs and Input Capture working on a HET and I've noticed something that could be a problem.

When I run my code on the debugger and halt the code with a breakpoint or whatever, I've noticed that the HET continues to run. If the HET is performing a safety critical task and the micro ceases to function for whatever reason, how do we ensure a safe shutdown of the HET?

Regards

Andy

  • Andy,

    You're noticing the 'IGNORE SUSPEND' behavior of the HET.  (Bit 17, HETGCR).  This is desireable when debugging some systems that don't tolerate PWMs stopping & starting as you halt at breakpoints.

    If the device were actually reset, the HET would also be initialized to it's reset state.

    However, if you want to implement some sort of interlock between the CPU running and the HET continuing to run, you can easily implement this with a DJZ instruction at the beginning of your HET code.   Basically have the DJZ decrement and if not zero, run the HET program.  If zero, enter a reset state on it's own.

    Then you can feed the DJZ instruction with the CPU while it's running.  If the CPU ever stops feeding the DJZ, your HET program will count down on the DJZ and when it gets to zero, it will switch to the code that puts it in the reset state.

    However long you want to let the HET run without 'hearing from' the CPU you can control by changing the DJZ value.  Each +1 would mean the HET could run 1 LRP without an update from the CPU before stopping.   So if the CPU writes '10' to the DJZ instruction, this would mean the HET could continue for 10 LRP periods after the CPU stops feeding it, before halting.

    That's one option that you should be able to easily implement;  but I'm sure there are other strategies you could employ as well.