AnsweredAssumed Answered

Enable/disable dedicated pin reset KL26

Question asked by JOAQUIM MARTINEZ on Mar 9, 2015
Latest reply on Mar 10, 2015 by JOAQUIM MARTINEZ

Hi all,


There is any possibility to enable and disable the KL26 dedicated external pin reset (PORTA, pin 20, PORTA_PCR20) by firmware?


In my app and at the first boot, I need to disable the pin reset. After 2 minutes, I woul like to use the pin reset. This is because I have an external watchdog that at the first power on of my device, it generates unconditionally a reset signal after 1 minute, because it has his own Power On Reset. Then every 1 minute it generates external reset signal if the KL26 doesn't send a wake signal before. This is because I need to bypass the first signal reset.


I'm using the PE (codewarrior procesor expert) in order to disable the reset control . Then, after 2 minutes I use this code in my firmware, to try to enable it, but doesn't work.


Code in red, is the same that PE generates. The code in blue is to activate the bit 3 (RESET_PIN_CFG bit) of FTFA_FOPT register, that theorically controls the reset pin.


My questions are:


1. This is possible to do?

2. Is the correct the code below?


    FTFA_FOPT |= 0x08;



   RCM_RPFW |= RCM_RPFW_RSTFLTSEL(0x1F);                                  


   RCM_RPFC = (uint8_t)((RCM_RPFC & (uint8_t)~(uint8_t)(RCM_RPFC_RSTFLTSRW(0x01))) | (uint8_t)(RCM_RPFC_RSTFLTSS_MASK | RCM_RPFC_RSTFLTSRW(0x02)));


   // S'activa pin reset.

   PORTA_PCR20 = (uint32_t)((PORTA_PCR20 & (uint32_t)~(uint32_t)(PORT_PCR_ISF_MASK)) | (uint32_t)(PORT_PCR_MUX(0x07)));


Thank you very much.