AnsweredAssumed Answered

Kinetis TWR-K60F120M ADC demo floating point math

Question asked by kpointer on Aug 12, 2013
Latest reply on Aug 14, 2013 by Zhe Tian

I've been modifying the ADC demo for the K60 tower board and have run into an issue with simple floating point math.  Integer math works fine but any floating point math causes the debugger to jump to the default ISR.  I can start a new project in CW with either the GNU or Freescale compiler and the math works fine. 

 

static float var1 = 19990;

static float var2 = 65535;

 

uint8_t Hw_Trig_Test(void)

{

var1 = (float)(var1) / (float)(var2);

...

 

The above math crashes with the adc demo but works fine with new projects.  Thoughts?

Outcomes