<?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 External read not working in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/External-read-not-working/m-p/134915#M781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I have a periperal decleared called pGraphicCTRL.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Writing data to this address works fine.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;but I wont to do this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;pGraphicCTRL = pGraphicCTRL | Graphic_CD&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This should generate a read and then a write on the data bus. I only get a write.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if I change it to&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;cControl = pGraphicCTRL;&lt;/DIV&gt;&lt;DIV&gt;pGraphicCTRL = cControl | Graphic_CD;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I still only get a write and if I step though the code the cControl = pGraphicCTRL line is not compiled in.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Why?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is this a optimizer thing if so its great job but not this time. What if my signal lines are different.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How do I get around it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can I turn the optimizer off?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Daniel&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Oct 2006 08:15:14 GMT</pubDate>
    <dc:creator>NZ_Design</dc:creator>
    <dc:date>2006-10-31T08:15:14Z</dc:date>
    <item>
      <title>External read not working</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/External-read-not-working/m-p/134915#M781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I have a periperal decleared called pGraphicCTRL.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Writing data to this address works fine.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;but I wont to do this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;pGraphicCTRL = pGraphicCTRL | Graphic_CD&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This should generate a read and then a write on the data bus. I only get a write.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if I change it to&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;cControl = pGraphicCTRL;&lt;/DIV&gt;&lt;DIV&gt;pGraphicCTRL = cControl | Graphic_CD;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I still only get a write and if I step though the code the cControl = pGraphicCTRL line is not compiled in.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Why?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is this a optimizer thing if so its great job but not this time. What if my signal lines are different.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How do I get around it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can I turn the optimizer off?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Daniel&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 08:15:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/External-read-not-working/m-p/134915#M781</guid>
      <dc:creator>NZ_Design</dc:creator>
      <dc:date>2006-10-31T08:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: External read not working</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/External-read-not-working/m-p/134916#M782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Did you define and declare pGraphicCTRL&amp;nbsp;as volatile?&lt;/DIV&gt;&lt;DIV&gt;This is the only way you can tell the compiler it should not optimize away memory access to&lt;/DIV&gt;&lt;DIV&gt;the variable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;volatile is recommended for all variables, which may change asynchronously from the normal execution flow (i.e. I/O ports, global variables modified in an interrupt functions, global variables modified in different tasks when you are running a multi-tasking application).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 18:59:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/External-read-not-working/m-p/134916#M782</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-10-31T18:59:59Z</dc:date>
    </item>
  </channel>
</rss>

