<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: exp,log and other math functions using CW for MCU Development Studio v10.6 and an MC9S08PA8 in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486408#M21847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Efthymios,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is possible to use the math functions in CW10.6. You need just include it:&lt;/P&gt;&lt;P&gt;#include &amp;lt;math.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It adds the math.h file from the installed CW package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Stano.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Feb 2016 13:19:37 GMT</pubDate>
    <dc:creator>Stano</dc:creator>
    <dc:date>2016-02-05T13:19:37Z</dc:date>
    <item>
      <title>exp,log and other math functions using CW for MCU Development Studio v10.6 and an MC9S08PA8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486407#M21846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;I am transfering a part of code from one MCU vendor (Atmel xmega32E5) to Freescale/NXP MC9S08PA8 MCU ,&lt;/P&gt;&lt;P&gt;and when I use the log function from math.h (i hope like other IDEs does)&amp;nbsp; the MCU "hits" endless restarts.&lt;/P&gt;&lt;P&gt;If i comment this line, MCU does its supposed job without any issue and i can see an ADC result on debugger crystal clear.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned int temp;&lt;/P&gt;&lt;P&gt;double ftemp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; System_Init();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Initialise system hardware/software modules&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; temp=ADC_Get_Sample(CH11);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Read current channel ADC value (54us@8MHz)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ftemp=log(((10240000/temp) - 10000));&amp;nbsp;&amp;nbsp; //Endless restart occurs - CRITICAL point&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) How /When do i&amp;nbsp; update/include the "math.h" or similar (?) library header ?&lt;/P&gt;&lt;P&gt;2) Does this IDE support floats and doubles for "small ones" like the PA16 MCU?&lt;/P&gt;&lt;P&gt;(I have chosen at the beggining bareboard project with IIEE 64bit float support)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 15:01:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486407#M21846</guid>
      <dc:creator>efthymioskondos</dc:creator>
      <dc:date>2016-02-03T15:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: exp,log and other math functions using CW for MCU Development Studio v10.6 and an MC9S08PA8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486408#M21847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Efthymios,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is possible to use the math functions in CW10.6. You need just include it:&lt;/P&gt;&lt;P&gt;#include &amp;lt;math.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It adds the math.h file from the installed CW package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Stano.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 13:19:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486408#M21847</guid>
      <dc:creator>Stano</dc:creator>
      <dc:date>2016-02-05T13:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: exp,log and other math functions using CW for MCU Development Studio v10.6 and an MC9S08PA8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486409#M21848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Default stack size set in PRM file is too short for S08 math functions. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 14:10:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486409#M21848</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2016-02-05T14:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: exp,log and other math functions using CW for MCU Development Studio v10.6 and an MC9S08PA8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486410#M21849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Edward &amp;amp; Stanislav for your fast response , &lt;/P&gt;&lt;P&gt;I will look into it as for math.h and modify(increase) the stack size of S08.&lt;/P&gt;&lt;P&gt;See how it goes, and get you feedback as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 08:37:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486410#M21849</guid>
      <dc:creator>efthymioskondos</dc:creator>
      <dc:date>2016-02-08T08:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: exp,log and other math functions using CW for MCU Development Studio v10.6 and an MC9S08PA8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486411#M21850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FIY ,&lt;/P&gt;&lt;P&gt;SOLVED according to Edward Karpicz and Stanislav suggestion. &lt;/P&gt;&lt;P&gt;So to use logx,log , exp functions , include your &amp;lt;math.h&amp;gt; on your project and also go to &lt;/P&gt;&lt;P&gt;Project Settings-&amp;gt;Linker_Files-&amp;gt;Project.prm , open file with double click&lt;/P&gt;&lt;P&gt;and edit&amp;nbsp; STACKSIZE from 0x80 (128bytes default size), to a bigger numer. &lt;BR /&gt;But beware, not to kill the entire RAM area by entering exotic hex number (For me it worked for 256bytes (0x100).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ef&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 09:57:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/exp-log-and-other-math-functions-using-CW-for-MCU-Development/m-p/486411#M21850</guid>
      <dc:creator>efthymioskondos</dc:creator>
      <dc:date>2016-02-08T09:57:19Z</dc:date>
    </item>
  </channel>
</rss>

