<?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>S12 / MagniV MicrocontrollersのトピックProblem of doing float operation in interrupt function or interrupt called function</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-doing-float-operation-in-interrupt-function-or/m-p/140775#M3145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;#pragma interrupt called&lt;BR /&gt;void sci_cmd()&lt;BR /&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; ……&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Kp=(float)(sci_rec_buffer[1]*256+sci_rec_buffer[2])*0.0001;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; ……&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/DIV&gt;&lt;DIV&gt;for example, runing&amp;nbsp;aboved function in sci interrupt function, but Kp(define as float type) isn't changed. I do these in codewarrior 6.0, and on 56F807&lt;/DIV&gt;&lt;DIV&gt;Thank you!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Jun 2006 21:13:18 GMT</pubDate>
    <dc:creator>dingding</dc:creator>
    <dc:date>2006-06-23T21:13:18Z</dc:date>
    <item>
      <title>Problem of doing float operation in interrupt function or interrupt called function</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-doing-float-operation-in-interrupt-function-or/m-p/140775#M3145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;#pragma interrupt called&lt;BR /&gt;void sci_cmd()&lt;BR /&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; ……&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Kp=(float)(sci_rec_buffer[1]*256+sci_rec_buffer[2])*0.0001;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; ……&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/DIV&gt;&lt;DIV&gt;for example, runing&amp;nbsp;aboved function in sci interrupt function, but Kp(define as float type) isn't changed. I do these in codewarrior 6.0, and on 56F807&lt;/DIV&gt;&lt;DIV&gt;Thank you!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 21:13:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-doing-float-operation-in-interrupt-function-or/m-p/140775#M3145</guid>
      <dc:creator>dingding</dc:creator>
      <dc:date>2006-06-23T21:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of doing float operation in interrupt function or interrupt called function</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-doing-float-operation-in-interrupt-function-or/m-p/140776#M3146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;First of all, I would not recommend doing floating point operations inside Interrupt Service Routines (ISR), because they might take too much time and you could loose characters from the serial port.&lt;BR /&gt;&lt;BR /&gt;A better alternative is to wait until all data has been received and then do the calculation (outside the Interrupt).&lt;BR /&gt;&lt;BR /&gt;As for your problem, you have to define Kp as volatile, so that it gets updated in the ISR. Otherwise, the compiler will optimize it out.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 23:41:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-doing-float-operation-in-interrupt-function-or/m-p/140776#M3146</guid>
      <dc:creator>alex_spotw</dc:creator>
      <dc:date>2006-06-23T23:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of doing float operation in interrupt function or interrupt called function</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-doing-float-operation-in-interrupt-function-or/m-p/140777#M3147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;It does well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jun 2006 14:19:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-doing-float-operation-in-interrupt-function-or/m-p/140777#M3147</guid>
      <dc:creator>dingding</dc:creator>
      <dc:date>2006-06-24T14:19:52Z</dc:date>
    </item>
  </channel>
</rss>

