<?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>CodeWarrior for MCUのトピックRe: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262938#M9986</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The f_temp variable is of integer type.&lt;/P&gt;&lt;P&gt;From your code I think that the f_temp variable could assume values between 0 and 65535 (16 bits), when the (f_temp) / (4096*28) = f_temp / 114.688 is executed the temporary result is between 0 and 1, and being of integer type it is reported as 0.&lt;/P&gt;&lt;P&gt;You should write beta = ((&lt;STRONG&gt;(float)&lt;/STRONG&gt;(f_temp) / (4096*28))*1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Teckna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Apr 2013 14:31:18 GMT</pubDate>
    <dc:creator>Teckna</dc:creator>
    <dc:date>2013-04-11T14:31:18Z</dc:date>
    <item>
      <title>POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262936#M9984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! Please consider the following code:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned int&amp;nbsp; beta;&lt;/P&gt;&lt;P&gt;unsigned int theta;&lt;BR /&gt;unsigned int m = 4;&lt;BR /&gt;unsigned int c = 986;&lt;BR /&gt;unsigned int Rpre = 49900;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned int getUAnalog(unsigned char channel) // to get the PT1000 Signal&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned int result;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned int f_temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //select channel and initiate conversion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADCSC1 |= (channel &amp;amp; 0b11111);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //wait until conversion is complete&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!ADCSC1_COCO);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f_temp = ADCRH;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f_temp &amp;lt;&amp;lt;= 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f_temp += ADCRL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; beta = (((f_temp) / (4096*28))*1000); // warning: possible loss of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; theta = ((((beta)*(Rpre))/(1-beta))*1000);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = (theta-c)/(m);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;I am using MC9S08DZ60 (&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fmicrocontrollers%2Fdoc%2Fdata_sheet%2FMC9S08DZ60.pdf" rel="nofollow" target="_blank"&gt;http://www.freescale.com/files/microcontrollers/doc/data_sheet/MC9S08DZ60.pdf&lt;/A&gt;) with PT1000-Temperature Sensor on CodeWarrior version 5.9.0 . &lt;/SPAN&gt;&lt;SPAN class="mce_paste_marker"&gt;This function is meant to calculate the temp and return "result". But the "beta" and "theta" values remain 0. No Change.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Also i get the warning as C2705: Possible Loss of Data.&amp;nbsp; The value of "result" is not right. PLease help as i dont have clue of what going wrong!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 13:45:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262936#M9984</guid>
      <dc:creator>sheetanshkaushi</dc:creator>
      <dc:date>2013-04-11T13:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262937#M9985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;That warning typically indicates that you are assigning a value larger than the destination can hold.&lt;/P&gt;&lt;P&gt;E.g. assigning something like 0x1234 to a 1 byte variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I quickly tried your code with CodeWarrior for MCU10.3 and I do not get such a warning, and the code looks ok. It looks like you are using an earlier version of the compiler/tool chain?&lt;/P&gt;&lt;P&gt;Not sure, but this could have been a bug with the optimizer. As a wild guess: could you use the -Ont option to see if this makes a difference?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 14:28:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262937#M9985</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2013-04-11T14:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262938#M9986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The f_temp variable is of integer type.&lt;/P&gt;&lt;P&gt;From your code I think that the f_temp variable could assume values between 0 and 65535 (16 bits), when the (f_temp) / (4096*28) = f_temp / 114.688 is executed the temporary result is between 0 and 1, and being of integer type it is reported as 0.&lt;/P&gt;&lt;P&gt;You should write beta = ((&lt;STRONG&gt;(float)&lt;/STRONG&gt;(f_temp) / (4096*28))*1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Teckna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 14:31:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262938#M9986</guid>
      <dc:creator>Teckna</dc:creator>
      <dc:date>2013-04-11T14:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262939#M9987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks teckna! the problem is i cant use float. Codewarrior version doesnt have float lib by default even after including the same it gives me a Link ERROR.&lt;/P&gt;&lt;P&gt;Would multiplying the whole value of "beta" with 1000 help with the answer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 14:45:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262939#M9987</guid>
      <dc:creator>sheetanshkaushi</dc:creator>
      <dc:date>2013-04-11T14:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262940#M9988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Erich, for your reply.&lt;/P&gt;&lt;P&gt;Tool chain version is 6.0;didnt think about it! Also i am relatively new to codewarrior so when you say "-Ont"... i am as lost as ever.&lt;/P&gt;&lt;P&gt;I hope you reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 14:49:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262940#M9988</guid>
      <dc:creator>sheetanshkaushi</dc:creator>
      <dc:date>2013-04-11T14:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262941#M9989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you should write beta = (f_temp*1000) / (4096*28);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Teckna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:07:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262941#M9989</guid>
      <dc:creator>Teckna</dc:creator>
      <dc:date>2013-04-11T15:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262942#M9990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks TEKNA!&lt;/P&gt;&lt;P&gt;That doesnt help either. Before you said it, i tried the same.&lt;/P&gt;&lt;P&gt;I tried to use bit shift operators to compute the multiplication and division but i get the warning and error stating unsigned int changed to unsigned char. Is there a better way to use bit shift operators?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:22:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262942#M9990</guid>
      <dc:creator>sheetanshkaushi</dc:creator>
      <dc:date>2013-04-11T15:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262943#M9991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;-Ont is a compiler option to disable the 'Tree Optimizer'. This optimizer performs optimizations on the logical structure of the program. Looking at the warning and the code, I was thinking that it might have been caused by such an optimization.&lt;/P&gt;&lt;P&gt;You could use the -Ont as command line option, or set it up in the preference panel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:24:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262943#M9991</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2013-04-11T15:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262944#M9992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again erich!&lt;/P&gt;&lt;P&gt;I will try setting up the "-ONT" option to disable the tree optimizer.&lt;/P&gt;&lt;P&gt;I just realised, when i had setup up the project using the wizard, i had not selected the floating point option(IEEE32). Is there a procedure to do the same in the middle of the project??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:38:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262944#M9992</guid>
      <dc:creator>sheetanshkaushi</dc:creator>
      <dc:date>2013-04-11T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262945#M9993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems very strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of beta depends on f_temp:&lt;/P&gt;&lt;P&gt;if f_temp&amp;gt;=115 then beta&amp;gt;0, if f_temp&amp;lt;115 then beta=0, have you verified it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;beta = f_temp*1000;&lt;/P&gt;&lt;P&gt;beta /= (4096*28);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Teckna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:38:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262945#M9993</guid>
      <dc:creator>Teckna</dc:creator>
      <dc:date>2013-04-11T15:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262946#M9994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THanks tekna!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now even i cant think... because what you suggested should logically work; IT DOES NOT! the value of f_temp is coming from the ADC which is always greater than 115.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:48:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262946#M9994</guid>
      <dc:creator>sheetanshkaushi</dc:creator>
      <dc:date>2013-04-11T15:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262947#M9995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sheetansh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is of the value of beta or in the one of theta?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If f_temp is between 115 and 229 then beta should be 1; in this condition when the statement theta = ((((beta)*(Rpre))/(1-beta))*1000); is executed, the value of 1-beta is 0 (at the denominator): this is a problem.&lt;/P&gt;&lt;P&gt;If f_temp&amp;gt;=230 then should be beta&amp;gt;2 and then (1-beta)&amp;lt;0.&lt;/P&gt;&lt;P&gt;Maybe it should be theta = ((((beta)*(Rpre))*1000)/(&lt;STRONG&gt;1000&lt;/STRONG&gt;-beta));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Teckna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 16:15:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262947#M9995</guid>
      <dc:creator>Teckna</dc:creator>
      <dc:date>2013-04-11T16:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262948#M9996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this is possible. Basically what you need to do is to change the library used (there is a readme text file on this inside the library folder), plus changing the compiler option.&lt;/P&gt;&lt;P&gt;But if you are rather a new user, it might be easier for you to create a new project with the wizard and either inspect the library/compiler option used, or to use that new project and copy your sources into it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 16:23:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262948#M9996</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2013-04-11T16:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262949#M9997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks tekna!&lt;/P&gt;&lt;P&gt;the fact is that the compiler doesnt raise any flag for the value of theta. It raises flag only for the value of beta(ie possible loss data). I tried as you suggested still the same.&lt;/P&gt;&lt;P&gt;ALso do you think its possible to perform the same equation using bitshift operator?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 16:23:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262949#M9997</guid>
      <dc:creator>sheetanshkaushi</dc:creator>
      <dc:date>2013-04-11T16:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262950#M9998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you considered that 4096 x 28 = 114688 is larger than will fit in an integer which for the S08 will be 16 bit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Breaking down your first line of maths (I added the spaces to make it more readable)&lt;/P&gt;&lt;P&gt;beta = ( ( (f_temp) / (4096*28) ) *1000 )&amp;nbsp; &lt;/P&gt;&lt;P&gt;beta = (f_temp/114688) * 1000;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do the multiplication and get rid of some excess parentheses&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that you are forcing the compiler to do the division before the multiplication x1000.&amp;nbsp; f_temp by definition is no larger than a 65536.&amp;nbsp; Which means that f_temp/(4096*28) is always &amp;lt; 1.&amp;nbsp; You are performing integer maths so this intermediate value should always result in 0.&amp;nbsp; I think this is why you are getting a warning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is really what you want to do, some of your intermediate variables should be uint32 (unsigned long)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 22:15:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262950#M9998</guid>
      <dc:creator>colinhoward</dc:creator>
      <dc:date>2013-04-11T22:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: POSSIBLE LOSS OF DATA-CODEWARRIOR</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262951#M9999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Further to my response below, maybe you should try something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;beta = (unsigned int)((f_temp * 1000uL) / (4096uL*28));&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better still, to avoid too much truncation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define DIVISOR (4096uL * 28)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;beta = (unsigned int)((f_temp * 1000uL + DIVISOR/2) / DIVISOR );&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;You will not get much, if any benefit by trying to use shift operators, since the only real potential is the 4096.&amp;nbsp; But since this needs to be multiplied by 28 anyway, you will need to handle this division regardless.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 02:45:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/POSSIBLE-LOSS-OF-DATA-CODEWARRIOR/m-p/262951#M9999</guid>
      <dc:creator>colinhoward</dc:creator>
      <dc:date>2013-04-15T02:45:17Z</dc:date>
    </item>
  </channel>
</rss>

