Hi,
I'm trying to implement a system shutdown if a limp mode of TMS320F28335 is detected. For doing this I need to close one relay connected to a GPIO output. I'm not sure if working in limp mode I can do a GPIO configuration like this (prior to InitSysCtrl):
void main(void) { //Check if device is operating in limp mode, wrong clock frequency (H.2.18.10.1 Frequency monitoring) //====================================================================================================== if(STL_CLOCK_FAIL_DETECT_checkMissingClock() == 1U ) // returns SysCtrlRegs.PLLSTS.bit.MCLKSTS { // Crec que ja no es resetejaria el DSP, només ho fa un cop a no sé que esborrem escrivint 1 a PLLSTS[MCLKCLR]. // El problema és que no val anar a a alarma i permetre ressetejar-ne alguna...ja que no tornaria a mirar el clock // S'hauria de resetejar DSP (però per watchdog no serveix): However, when the external input clock fails, // the watchdog counter stops decrementing (that is, the watchdog counter does not change with the limp-mode clock). EALLOW; GpioCtrlRegs.GPCMUX1.bit.GPIO73=0; //GPIO GpioCtrlRegs.GPCDIR.bit.GPIO73= 1;// Sortida GpioCtrlRegs.GPCPUD.bit.GPIO73=1; // DESHABILITA PULL-UP INTE //Relé 11 (Contacte 1 relé biestable: és el que obra el relé) GpioCtrlRegs.GPCMUX1.bit.GPIO74=0; //GPIO GpioCtrlRegs.GPCDIR.bit.GPIO74= 1;// Sortida GpioCtrlRegs.GPCPUD.bit.GPIO74=1; // DESHABILITA PULL-UP INTE //Relé 12 (Contacte 2 relé biestable: és el que tanca el relé) GpioCtrlRegs.GPCMUX1.bit.GPIO75=0; //GPIO GpioCtrlRegs.GPCDIR.bit.GPIO75= 1;// Sortida GpioCtrlRegs.GPCPUD.bit.GPIO75=1; // DESHABILITA PULL-UP INTE EDIS; GpioDataRegs.GPCCLEAR.bit.GPIO73 =1; // Open Relay 10 to shut-down power supply GpioDataRegs.GPCSET.bit.GPIO74 =1; // Close Relay 11 to open biestable relay GpioDataRegs.GPCCLEAR.bit.GPIO75 =1; // Open Relay 12 to open biestable relay asm(" ESTOP0"); // It stops emulation mode } // System Initialization (@TODO TREURE HALT //======================================================================================================== InitSysCtrl(); // This function initializes the System Control registers to a known state. // This funcion ensures that the PLL finishes to lock at the desired frequency and that PLL is stable.
Is it ok?
Thank you!!
Maite