AnsweredAssumed Answered

do floating point supported in mc912zvca192

Question asked by Sathish kannan on Nov 17, 2015
Latest reply on Nov 26, 2015 by Radek Sestak

Hi I checked floating point program but its showing error

 

#include <hidef.h> /* for EnableInterrupts macro */

#include "derivative.h" /* include peripheral declarations */

 

 

#include "math.h"

 

 

 

 

 

 

 

 

void main(void) {

 

 

  EnableInterrupts;

  /* include your code here */

 

 

  float a=4.5;

  float b=5.5;

  float c;

 

  c=a+b;

  for(;;) {

    __RESET_WATCHDOG(); /* feeds the dog */

   

  } /* loop forever */

  /* please make sure that you never leave main */

 

 

}

 

how to correct this code to check floating point operations?

 

i need to do natural log calculations also for below mentioned expression will it possible ?

 

 

 

 

 

 

 

#define A1    -13.4088568

#define B1     4547.9615

#define C1    -176965.92

#define D1     3861154

#define R25    10000        //10KOHM

#define R1     1000          // 1KOHM

 

 

//To Find Rt

Rt = {(4096/ADC)-1}*R1

 

 

//and To Find Temprature T

 

 

RtR25   =Rt/R25

result1 = log(Rt);

result2 = log(Rt)*log(Rt);

result3 = log(Rt)*log(Rt)*log(Rt);

 

 

//TEMP_KELVIN =1/(A1+B1+ln[Rt/R25]+C1ln2[Rt/R25]+D1ln3[Rt/R25]) (ln-natural log)

 

 

 

 

TEMP_KELVIN =1/(A1+B1+result1+(C1*result2)+(D1*result3))

TEMP_DEGREE=TEMP_KELVIN+273

Outcomes