How to compute log operation using SAM E70 & Atmel studio 7 IDE

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Has anyone used LOG operator along with atmel SAM 70 mcu & Atmel Studio & IDE?

My actual requirement is to measure the temperature using a NCP18WF104J03RB temperature sensor.

Every equation that I have come across makes use of LOG operator & I couldn't find that same in math.h header file.

So am wondering how to get through this issue?

The temperature VS resistance graph given in the sensor datasheet is not quite suitable for deriving a relation between temperature & resistance.

This topic has a solution.

Silly beans are always silly
:)

Last Edited: Thu. Mar 16, 2017 - 05:24 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since I had no idea like how to perform log operation using SAM E70, what I did was, i checked the resistance vs temperature plot of NCP18WF104J03RB & then divided it into small segments & found the linear equation for each segment & when the ADC reads a value, controller checks the range & then compute corresponding equation to get an approximate temperature.

It won't be that precise, but it works for me.

Silly beans are always silly
:)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

log() really ought to be in math.h - it seems to work when I include math.h, but I'm not sure that it gets the "right" log() function.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

arm_math.h right?

I can see that header file in my project folder, but there isn't any log function.

Am I missing something like some sort of setting that I needs to changed in my Atmel Studio?

smiley

Silly beans are always silly
:)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

no, just math.h, I think.   math.h covers the standard C math functions, arm_math.h is part of (?) CMSIS/DSP, and contains "other" functions and/or arm-specific implementations.

(like trig functions for fractional integers, apparently.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, you are right. Usually math.h covers all the standard C math functions.

But here it seems different.

Atmel support says that, this function is not yet implemented in ARM CMSIS DSP libraries, so they requested us to contact ARM and see if they has got any updates.

frown!!!

Silly beans are always silly
:)

Last Edited: Fri. Mar 17, 2017 - 05:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

>> this function is not yet implemented in ARM CMSIS DSP libraries

It doesn't NEED to be implemented in the CMSIS DSP libraries.   It's already implemented in the libgcc/libm libraries (unless you need it to work on the q31 datatypes used by the CMSIS DSP library.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

then why couldn't i find that header file?

I searched for the same & "arm_math.h" is what they displayed.

:(

Silly beans are always silly
:)