<?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: linck error?? in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151058#M8149</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hey Mac do you know how to get out a integer part of a float number in C?&lt;/DIV&gt;&lt;DIV&gt;Because when I load the float number in a PVAL registers and debug the proyetc The compiller diplay&amp;nbsp; a message :warning convert float to integer but the signal is completely a disaster&lt;/DIV&gt;&lt;DIV&gt;sorry for my inglish&lt;/DIV&gt;&lt;DIV&gt;Muchas Gracias!!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Feb 2009 21:56:44 GMT</pubDate>
    <dc:creator>quimey</dc:creator>
    <dc:date>2009-02-12T21:56:44Z</dc:date>
    <item>
      <title>linck error??</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151055#M8146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;This is from my tesis ,is a v/f&amp;nbsp; motor control ,for the v/f scale i need to scale the modulus of the pwm,but i need to use a float operation for decimal results&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;The problem is when i use the&amp;nbsp;operation ./ this is the code:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;(is a mr32 8 bits microcontroler)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;#include &amp;lt;hidef.h&amp;gt; /* for EnableInterrupts macro */&lt;BR /&gt;#include "derivative.h" /* include peripheral declarations */&lt;BR /&gt;#include "sinetables.h"&lt;BR /&gt;unsigned char TableIndex = 0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;int leer=1;&lt;BR /&gt;int ADC_IN;&lt;BR /&gt;int i=1;&lt;BR /&gt;float ADC_FLOT;&lt;BR /&gt;float k;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;if(ADC_IN&amp;lt;0X2FC){&lt;BR /&gt;k=1;}&lt;BR /&gt;if(0x2FC&amp;lt;=ADC_IN&amp;lt;=0x9F2){&lt;BR /&gt;k=ADC_IN*9/.17820;&lt;BR /&gt;k=-k+1.38585;&lt;BR /&gt;}&lt;BR /&gt;if(ADC_IN&amp;lt;0X9F2){&lt;BR /&gt;k=0.1;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PVAL1 =k * PHASE_A[TableIndex];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PVAL3 =k * PHASE_B[TableIndex];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PVAL5 =k * PHASE_C[TableIndex];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; leer=PCTL1_LDOK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PCTL1 |= 0x02;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Load new PWM values */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; TableIndex++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Update Table Index */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (TableIndex == 64)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TableIndex = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Reset Table Index */&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;when I compiling te code warrior display tihs message:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;Link Error&amp;nbsp;&amp;nbsp; : L1822: Symbol _FSFLOAT in file C:\Documents and Settings\COMPAC\Mis documentos\SENOFRECVAR307\SENOFRECVAR307_Data\Standard\ObjectCode\main.c.o&lt;BR /&gt;is undefined&lt;BR /&gt;&lt;BR /&gt;Link Error&amp;nbsp;&amp;nbsp; : L1822: Symbol _FDIV_RC in file C:\Documents and Settings\COMPAC\Mis documentos\SENOFRECVAR307\SENOFRECVAR307_Data\Standard\ObjectCode\main.c.o&lt;BR /&gt;is undefined&lt;BR /&gt;&lt;BR /&gt;Link Error&amp;nbsp;&amp;nbsp; : L1822: Symbol _FNEG in file C:\Documents and Settings\COMPAC\Mis documentos\SENOFRECVAR307\SENOFRECVAR307_Data\Standard\ObjectCode\main.c.o&lt;BR /&gt;is undefined&lt;BR /&gt;&lt;BR /&gt;Link Error&amp;nbsp;&amp;nbsp; : L1822: Symbol _FADD_RC in file C:\Documents and Settings\COMPAC\Mis documentos\SENOFRECVAR307\SENOFRECVAR307_Data\Standard\ObjectCode\main.c.o&lt;BR /&gt;is undefined&lt;BR /&gt;&lt;BR /&gt;Link Error&amp;nbsp;&amp;nbsp; : L1822: Symbol _FUFLOAT in file C:\Documents and Settings\COMPAC\Mis documentos\SENOFRECVAR307\SENOFRECVAR307_Data\Standard\ObjectCode\main.c.o&lt;BR /&gt;is undefined&lt;BR /&gt;&lt;BR /&gt;Link Error&amp;nbsp;&amp;nbsp; : L1822: Symbol _FMUL in file C:\Documents and Settings\COMPAC\Mis documentos\SENOFRECVAR307\SENOFRECVAR307_Data\Standard\ObjectCode\main.c.o&lt;BR /&gt;is undefined&lt;BR /&gt;&lt;BR /&gt;Link Error&amp;nbsp;&amp;nbsp; : L1822: Symbol _FSTRUNC in file C:\Documents and Settings\COMPAC\Mis documentos\SENOFRECVAR307\SENOFRECVAR307_Data\Standard\ObjectCode\main.c.o&lt;BR /&gt;is undefined&lt;BR /&gt;&lt;BR /&gt;Link Error&amp;nbsp;&amp;nbsp; : Link failed&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I must to installing codewarrior libraris&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;from were?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 07:27:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151055#M8146</guid>
      <dc:creator>quimey</dc:creator>
      <dc:date>2009-02-10T07:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: linck error??</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151056#M8147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;When you created the CW project, did you specify that floating point operations were required?&amp;nbsp; This needs to be done in order to link the correct ANSI library file, that supports floating point operations.&lt;BR /&gt;&lt;BR /&gt;However, since the PWMMC module is eventually loaded with 16-bit values, I would suspect that it should be possible to avoid the need for floating point calculations, and the conversion of floating point values to integer values, with the associated code size and timing penalties.&amp;nbsp; The careful use of integer calculations should be able to maintain 16-bit precision.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mac&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2009-02-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:21 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 12:18:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151056#M8147</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-02-10T12:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: linck error??</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151057#M8148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thank you sow much for you help!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;I created the project again and it`s worck.&lt;/DIV&gt;&lt;DIV&gt;For the second ,I must to create a carrier of 8khz thit borders the PMOD to 0X307.&lt;/DIV&gt;&lt;DIV&gt;Bay&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 08:07:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151057#M8148</guid>
      <dc:creator>quimey</dc:creator>
      <dc:date>2009-02-11T08:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: linck error??</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151058#M8149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hey Mac do you know how to get out a integer part of a float number in C?&lt;/DIV&gt;&lt;DIV&gt;Because when I load the float number in a PVAL registers and debug the proyetc The compiller diplay&amp;nbsp; a message :warning convert float to integer but the signal is completely a disaster&lt;/DIV&gt;&lt;DIV&gt;sorry for my inglish&lt;/DIV&gt;&lt;DIV&gt;Muchas Gracias!!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2009 21:56:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151058#M8149</guid>
      <dc:creator>quimey</dc:creator>
      <dc:date>2009-02-12T21:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: linck error??</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151059#M8150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;It would seem that your calculation applies to a range of decimal values for ADC_IN of 764 to 2545.&lt;BR /&gt;&lt;BR /&gt;Now consider the calculation -&lt;BR /&gt;&lt;FONT face="Courier New"&gt;k = ADC_IN*9/.17820;&lt;BR /&gt;&lt;FONT face="Arial"&gt;Alternatively, this could be expressed as -&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;k = ADC_IN*50.50505;&lt;BR /&gt;&lt;FONT face="Arial"&gt;This will give a calculated range 38586.8.. to 128535.3..&lt;BR /&gt;&lt;BR /&gt;The next calculation&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT face="Verdana"&gt;&lt;FONT face="Courier New"&gt;k = -k+1.38585;&lt;/FONT&gt;&amp;nbsp; &lt;FONT face="Arial"&gt;will negate slightly reduced values.&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;&lt;BR /&gt;&lt;FONT face="Arial"&gt;The next three calculations are similar to -&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="Verdana"&gt;&lt;FONT face="Courier New"&gt;PVAL1 = k * PHASE_A[TableIndex];&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Arial"&gt;You have not revealed what values are in the table, and whether they are floating point or integer.&amp;nbsp; However, my understanding is that PVALx variables provide an integer value.&amp;nbsp; If a table value should exceed 0.254, it is possible for an overflow condition and an erroneous conversion from floating point.&lt;BR /&gt;&lt;BR /&gt;I wonder if this is your problem.&amp;nbsp; I also note that the calculated values are always negative (assuming table values are positive).&amp;nbsp; Is this correct?&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mac&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2009 23:20:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/linck-error/m-p/151059#M8150</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-02-12T23:20:13Z</dc:date>
    </item>
  </channel>
</rss>

