<?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>Classic/Legacy CodeWarriorのトピックRe: How do you force byte writes to memory using CW?</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-do-you-force-byte-writes-to-memory-using-CW/m-p/127102#M221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Joe,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;It seems that a &lt;EM&gt;short&lt;/EM&gt; is actually 16 bit size.&amp;nbsp; I had no problem with the following code:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;typedef unsigned char byte;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;byte data = 0x41;&lt;BR /&gt;byte *address;&lt;BR /&gt;byte dest;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;address = &amp;amp;temp;&lt;BR /&gt;*address = data;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2006 11:41:00 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2006-02-24T11:41:00Z</dc:date>
    <item>
      <title>How do you force byte writes to memory using CW?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-do-you-force-byte-writes-to-memory-using-CW/m-p/127100#M219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I am using the following code segment to write a data byte&amp;nbsp;to an absolute memory location, held in "address" :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;*(uint8 *)(address) = (uint8)data;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;uint8 is defined as follows:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;typedef unsigned short int uint8;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The problem is, the code is doing word (16 bit) memory accesses.&amp;nbsp; What am I doing wrong?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Joe&lt;/DIV&gt;&lt;P&gt;Message Edited by nanoGeek on &lt;SPAN class="date_text"&gt;02-23-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;09:59 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by nanoGeek on &lt;SPAN class="date_text"&gt;02-23-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;10:00 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2006 23:53:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-do-you-force-byte-writes-to-memory-using-CW/m-p/127100#M219</guid>
      <dc:creator>nanoGeek</dc:creator>
      <dc:date>2006-02-23T23:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do you force byte writes to memory using CW?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-do-you-force-byte-writes-to-memory-using-CW/m-p/127101#M220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;You can write in RAM like this :&lt;BR /&gt;&lt;BR /&gt;//SOLUTION 1 :&lt;BR /&gt;&lt;BR /&gt;//All pointer size depends of the machine.. (i.e 2 bytes)&lt;BR /&gt;char *memPtr;&lt;BR /&gt;char theContent;&lt;BR /&gt;unsigned short int memItr;&lt;BR /&gt;&lt;BR /&gt;//Initialize ram (write) //0x1000 to 0x1010&lt;BR /&gt;//... We write to 16 locations&lt;BR /&gt;memPtr = (signed char*) 0x1000;&lt;BR /&gt;for (memItr = 0 ; memItr 16 ; memItr++)&lt;BR /&gt;{&lt;BR /&gt;(*memPtr) = 0x55; //Write an acsii char..&lt;BR /&gt;memPtr = memPtr + 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//Init the ptr and itr&lt;BR /&gt;memPtr = (signed char*) 0x1000; //Memory ptr&lt;BR /&gt;memItr = 0;&lt;BR /&gt;&lt;BR /&gt;//Display&lt;BR /&gt;printf("Memory display (Ram 0x1000 to 0x1010)... ");&lt;BR /&gt;for (memItr;memItr16&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;BR /&gt;{&lt;BR /&gt;memItr++; theContent = (*memPtr); //display the content.(HEX_TO_ASCII?)&lt;BR /&gt;memPtr = memPtr + 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//SOLUTION 2 :&lt;BR /&gt;char lFillRam[ARR_DIM]; //Array of character&lt;BR /&gt;for (memItr=0 ; memItr&lt;BR /&gt;{&lt;BR /&gt;lFillRam[memItr] = 'U';&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to write in Flash or Eeprom, you have to follow some special algorithm (procedure). See the AN for you MCU&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 01:14:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-do-you-force-byte-writes-to-memory-using-CW/m-p/127101#M220</guid>
      <dc:creator>desroc01</dc:creator>
      <dc:date>2006-02-24T01:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you force byte writes to memory using CW?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-do-you-force-byte-writes-to-memory-using-CW/m-p/127102#M221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Joe,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;It seems that a &lt;EM&gt;short&lt;/EM&gt; is actually 16 bit size.&amp;nbsp; I had no problem with the following code:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;typedef unsigned char byte;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;byte data = 0x41;&lt;BR /&gt;byte *address;&lt;BR /&gt;byte dest;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;address = &amp;amp;temp;&lt;BR /&gt;*address = data;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 11:41:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-do-you-force-byte-writes-to-memory-using-CW/m-p/127102#M221</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-02-24T11:41:00Z</dc:date>
    </item>
  </channel>
</rss>

