Hello,
I am programming the digital signal controller TMS320F2812. Under a fault condition, I want the controller to terminate the execution of the control program and all other activity until the device is reset.That is, the controller should exit the infinite loop in which it normally stays, and also stop everything else such as the timers.
So far I have tried the statement return 0; in the following program structure:
int main(){
// variable declarations
// register setups
while (1){
if (fault condition)
return 0;
// control program
}
}
Apparently the code execution is indeed stopped when the fault occurs. However, the timer output is still functioning; it keeps outputting a pulse sequence. The bits T1CON.FREE and SOFT are both set to 0 and thus the timer stops on emulation suspend. I therefore expect the timer to stop operating when the program is terminated as well. Setting T1PIN to zero before the return statement forces the timer output low, but I would rather have the timer (and all other peripherals) stop operating completely. How can that be achieved?
Regards,
Adrian