AnsweredAssumed Answered

freedom KL46Z board seems to only run briefly

Question asked by Russell Sher on May 7, 2015
Latest reply on Jun 11, 2015 by Russell Sher

Hi All- I am using the freedom KL46Z board. When I run any code after copying (downloading) the hex file to the FRDM-KL46Z E: drive (as it appears on my PC),  the code appears to only work for a short duration: e.g. I had two successive lines to print a char to a terminal - It only prints the first, each time I reset, it just prints the first char. I thought it was my uart routine, so I used the code below just to light an led -

Bit1_SetVal(); switches the led off and Bit1_ClrVal(); switches it on.


If I do:



then the led lights, but if I do say...




then it doesn't light. It is as though the extra delay caused by the extra line of code has stopped the main code.

It seems to be a watchdog type issue, but I have included the default line: PE_low_level_init();


Here is the code fragment for the led routine:



  /* Write your local variable definition here */



  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/


  /*** End of Processor Expert internal initialization.                    ***/


  /* Write your code here */

  /* For example: for(;;) { } */


  Bit1_SetVal(); // If I comment this out the led lights






  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/