<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: Newbie question</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169859#M6216</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;MCGC2 = MCGC2 &amp;amp; 0b11111111;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;does not compile (int to unsigned char conversion error).&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jul 2008 03:15:33 GMT</pubDate>
    <dc:creator>gbaars</dc:creator>
    <dc:date>2008-07-03T03:15:33Z</dc:date>
    <item>
      <title>Newbie question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169857#M6214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;In a first try on the DEMOJM with MCF51JM128&lt;/DIV&gt;&lt;DIV&gt;(blinking a led) the watch dog is disabled.&lt;/DIV&gt;&lt;DIV&gt;Before blinking loop the line&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;MCGC2 = MCGC2 &amp;amp;&amp;amp; 0b11111111;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;seems to double the busfreq (why effect at all?)??&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 02:29:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169857#M6214</guid>
      <dc:creator>gbaars</dc:creator>
      <dc:date>2008-07-03T02:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169858#M6215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BR /&gt;Because &amp;amp;&amp;amp; resolves to true or false.&lt;BR /&gt;&lt;BR /&gt;Did you mean '&amp;amp;'?&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 02:36:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169858#M6215</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-07-03T02:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169859#M6216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;MCGC2 = MCGC2 &amp;amp; 0b11111111;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;does not compile (int to unsigned char conversion error).&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 03:15:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169859#M6216</guid>
      <dc:creator>gbaars</dc:creator>
      <dc:date>2008-07-03T03:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169860#M6217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; MCGC2 = MCGC2 &amp;amp; 0b11111111;&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; does not compile (int to unsigned char conversion error).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Arithmetic operators produce integer results by default, and an implicit cast from an integer to an unsigned char produces a warning/error by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might try an unsigned char operator:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCGC2 &amp;amp;= 0b11111111;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or an explicit cast:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCGC2 = (unsigned char)(MCGC2 &amp;amp; 0b11111111);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or just disable the error/warning:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; turn off "Implicit Arithmetic Conversions" in project settings -&amp;gt; C/C++ Warnings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually run with that error/warning disabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Rich&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 08:02:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169860#M6217</guid>
      <dc:creator>RichTestardi</dc:creator>
      <dc:date>2008-07-03T08:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169861#M6218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Works fine.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 16:25:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169861#M6218</guid>
      <dc:creator>gbaars</dc:creator>
      <dc:date>2008-07-03T16:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169862#M6219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Well, some would recommend that you not turn off warnings, and that you explicitly cast to eliminate the warnings.&lt;BR /&gt;&lt;BR /&gt;If fact, if you need to comply with a standard, like MIRSA, you are not permitted to turn warnings off.&lt;BR /&gt;&lt;BR /&gt;Although it may seem warnings are just an annoyance, sometimes they do point to a problem.&lt;BR /&gt;I have used pragmas to disable certain warnings for a small block of code, but never disable them completely.&lt;BR /&gt;Also, if you work professionally, you may be required to leave them on, so you should learn about them.&lt;BR /&gt;&lt;BR /&gt;Code that compiles clean with warnings off is not code that really is clean, and if you decide later to turn them back on you will have a big job to go fix them all.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 22:24:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-question/m-p/169862#M6219</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-07-03T22:24:33Z</dc:date>
    </item>
  </channel>
</rss>

