<?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: why pow() is not working in codewarrior? in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/why-pow-is-not-working-in-codewarrior/m-p/294658#M523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Khalid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a project with the wizard for 9s12DG256B.&lt;/P&gt;&lt;P&gt;This example is using the Full Chip Simulator (FCS).&lt;/P&gt;&lt;P&gt;The pow instruction seems to be running fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I added a part of your code and for me it's running fine.&lt;/P&gt;&lt;P&gt;Attached the project and the debugger view.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2014 12:26:20 GMT</pubDate>
    <dc:creator>trytohelp</dc:creator>
    <dc:date>2014-05-16T12:26:20Z</dc:date>
    <item>
      <title>why pow() is not working in codewarrior?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/why-pow-is-not-working-in-codewarrior/m-p/294657#M522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I like to turn on a specific 7-segment display (total 4 7segment display) in Dragon12 plus development board. I want to select a specific 7-segment display (out of 4) and light with a specific no. (here i am showing 6 (to show 6 i put 125(decimal) ). Now in the following program x1=2 (that means 1st 7-segment should be on and it works, (counted like 0th, 1st, 2nd and 3rd ) ) and shows 6 that i want to show . But I want to use x1=pow(2, &lt;/STRONG&gt;) &lt;STRONG&gt;. So when I used &lt;STRONG&gt;x1=pow(2, &lt;/STRONG&gt;1) it select the right 7-segment display but it does not show 6. instead it shows something wired (nothing meaningful in that 7segment display). WHY???&amp;nbsp; &lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Example 1a: Turn on every other segment on 7-seg display&lt;/P&gt;&lt;P&gt;#include &amp;lt;hidef.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* common defines and macros */&lt;/P&gt;&lt;P&gt;#include &amp;lt;mc9s12dg256.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* derivative information */&lt;/P&gt;&lt;P&gt;#include "math.h"&lt;/P&gt;&lt;P&gt;#pragma LINK_INFO DERIVATIVE "mc9s12dg256b"&lt;/P&gt;&lt;P&gt;#include "main_asm.h" /* interface to the assembly module */&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; int s; &lt;/P&gt;&lt;P&gt; float b ;&lt;/P&gt;&lt;P&gt; float x ;&lt;/P&gt;&lt;P&gt;float x1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; PLL_init();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set system clock frequency to 24 MHz &lt;/P&gt;&lt;P&gt;&amp;nbsp; DDRB&amp;nbsp; = 0xff;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Port B is output&lt;/P&gt;&lt;P&gt;&amp;nbsp; DDRJ&amp;nbsp; = 0xff;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Port J is output&lt;/P&gt;&lt;P&gt;&amp;nbsp; DDRP&amp;nbsp; = 0xff;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Port P is output&lt;/P&gt;&lt;P&gt;&amp;nbsp; PTJ = 0x02;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // disable LED&amp;nbsp; 0x02&lt;/P&gt;&lt;P&gt;&amp;nbsp; PTP = 0xff;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // disable all 7-segment displays&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;PORTB&amp;nbsp;&amp;nbsp; = 0x00 ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; s =125;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; b=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; x1=pow(2,b);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; x=15-x1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; PTP = x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; PORTB = s;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 22:45:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/why-pow-is-not-working-in-codewarrior/m-p/294657#M522</guid>
      <dc:creator>khalidsakib</dc:creator>
      <dc:date>2014-05-09T22:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: why pow() is not working in codewarrior?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/why-pow-is-not-working-in-codewarrior/m-p/294658#M523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Khalid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a project with the wizard for 9s12DG256B.&lt;/P&gt;&lt;P&gt;This example is using the Full Chip Simulator (FCS).&lt;/P&gt;&lt;P&gt;The pow instruction seems to be running fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I added a part of your code and for me it's running fine.&lt;/P&gt;&lt;P&gt;Attached the project and the debugger view.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 12:26:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/why-pow-is-not-working-in-codewarrior/m-p/294658#M523</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2014-05-16T12:26:20Z</dc:date>
    </item>
  </channel>
</rss>

