<?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 Re: more flash write problemo's in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131293#M2701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, Jah:&lt;BR /&gt;&lt;BR /&gt;Are you running this routine in ram?&lt;BR /&gt;&lt;BR /&gt;If so, how are you moving it to ram?&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Sep 2006 08:10:42 GMT</pubDate>
    <dc:creator>rocco</dc:creator>
    <dc:date>2006-09-26T08:10:42Z</dc:date>
    <item>
      <title>more flash write problemo's</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131292#M2700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;my CW debug environment dosnt work around this code, what's the bad?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alot of the project code is working but nothing makes sense here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i see the code work on a byte or two sometimes so maybe close.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//segment in main.com&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Flash_Erase (0xE001);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for(FixedAddres = 0xE000; FixedAddres0xF000; FixedAddres++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Flash_Program(0x99);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//the main.com segment calls these two functions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//*********&amp;gt;&amp;gt;&amp;gt; erases the page where of Flash indicated by FlashAddress ***********&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void Flash_Erase (unsigned int FlashAddress){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FixedAddres = FlashAddress;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(FSTAT &amp;amp;0x10) FSTAT |= 0x10; //write a 1 to FACCERR to clear only if error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*(volatile unsigned char *)FixedAddres = 0xFF; //write anything anywhere&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FCMD = 0x40; //page erase command type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FSTAT |= 0x80; //Put FSTAT/FCBEF = launch a new burst command &amp;amp; wait 4 cycles&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while (!(FSTAT &amp;amp; 0x40)); //else wait for comand to complete&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}//************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//*************&amp;gt;&amp;gt;&amp;gt; write byte of data onto the Flash **************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void Flash_Program(Byte data){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (FSTAT &amp;amp;0x10) FSTAT |= 0x10; //write a 1 to FACCERR to clear&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//write to flash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*(volatile unsigned char *)FixedAddres = (unsigned char)data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FCMD = 0x20; //set command type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FSTAT |= 0x80; //Put FCBEF at 1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP; //Wait 4 cycles&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_asm NOP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while (!(FSTAT &amp;amp; 0x40)); //else wait for comand to complete&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}//************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//this varriable is global and looks like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extern unsigned int FixedAddres;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2006 07:14:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131292#M2700</guid>
      <dc:creator>jah</dc:creator>
      <dc:date>2006-09-26T07:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: more flash write problemo's</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131293#M2701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, Jah:&lt;BR /&gt;&lt;BR /&gt;Are you running this routine in ram?&lt;BR /&gt;&lt;BR /&gt;If so, how are you moving it to ram?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2006 08:10:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131293#M2701</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-09-26T08:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: more flash write problemo's</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131294#M2702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;the routine is running about 0x9000 but in flash&lt;BR /&gt;the main.c above are ment to modify flash around 0xE000&lt;BR /&gt;&lt;BR /&gt;thanks for the reply.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2006 21:34:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131294#M2702</guid>
      <dc:creator>jah</dc:creator>
      <dc:date>2006-09-26T21:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: more flash write problemo's</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131295#M2703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;additonal info:&lt;BR /&gt;FCDIV = 0x27 //8Mhz clock from "MC9S08RG60/D Rev. 1.11 06/2005" p50/table4.6&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2006 00:29:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131295#M2703</guid>
      <dc:creator>jah</dc:creator>
      <dc:date>2006-09-27T00:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: more flash write problemo's</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131296#M2704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi jah,&lt;/DIV&gt;&lt;DIV&gt;These devices only have one array of FLASH.&lt;/DIV&gt;&lt;DIV&gt;You must execute from RAM to erase/programme any of it.&lt;/DIV&gt;&lt;DIV&gt;See the many other threads on this subject.&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;David&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2006 03:40:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/more-flash-write-problemo-s/m-p/131296#M2704</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2006-09-27T03:40:26Z</dc:date>
    </item>
  </channel>
</rss>

