<?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: Flash/NV Memory writing in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-NV-Memory-writing/m-p/156756#M4080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The amount of code presently written for this application is small, but the IO is pretty much maxed out (so external EEPROM not easily implemented).&amp;nbsp; I noticed the NVRAM registers.&amp;nbsp; Is there an easy way to write to these?&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Nov 2009 23:34:11 GMT</pubDate>
    <dc:creator>danes</dc:creator>
    <dc:date>2009-11-24T23:34:11Z</dc:date>
    <item>
      <title>Flash/NV Memory writing</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-NV-Memory-writing/m-p/156754#M4078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to Freescale technology and want to be able to write a byte to NV RAM or Flash memory.&amp;nbsp; Through several searches and manuals I have found methods, but all of these seem more difficult than necessary.&amp;nbsp; Many of the examples are in assembly language.&amp;nbsp; Is there a good and easy example of writing a single byte to NV RAM or Flash (preferably that does not require resets and changing clock frequency dividers)?&amp;nbsp; I am use to MCUs that have EEPROMs, so something this simple would be great.&amp;nbsp; I am using a MC9S08AW60 using the internal oscillator at 8MHz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2009 21:56:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-NV-Memory-writing/m-p/156754#M4078</guid>
      <dc:creator>danes</dc:creator>
      <dc:date>2009-11-24T21:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Flash/NV Memory writing</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-NV-Memory-writing/m-p/156755#M4079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;There is no easy way, Freescale flash memory is very dumb.&lt;BR /&gt;&lt;BR /&gt;Typically, you will have to first copy down your code into RAM (very questionable from a safety point-of-view) because you can't execute the code from the same flash "bank" that you are writing to. One bank is typically the whole friggin memory of the MCU. Newer MCUs have "data flash" that you can write directly too without downloading the code into RAM.&lt;BR /&gt;&lt;BR /&gt;Next problem is that banks are divided into big blocks of 128, 256 or 512 bytes. You must erase a whole block to write a single byte. This means you must also copy down a huge amount of data to RAM, alter the cell you want to change, then write it back.&lt;BR /&gt;&lt;BR /&gt;All of this takes lots of execution time, and you will want to consider what will happen if the MCU loses power into the middle of the write. Not pretty at all. You will need to implement checksums and perhaps also mirror memory segments, to preserve data integrity. Even more execution time.&lt;BR /&gt;&lt;BR /&gt;Note that the new "data flash" solves neither the block size problem or the power loss problem, it is equally huge (128 bytes). The competition has smarter data flash that works like old eeproms.&lt;BR /&gt;&lt;BR /&gt;Practically, all of this means you have two sensible options. I use either of them when I have the same requirements as you have:&lt;BR /&gt;&lt;BR /&gt;- Switch to a derivate with (emulated) eeprom, like the S08D or S12D families. Or&lt;BR /&gt;- Switch to Renesas for the particular project.&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Lundin on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-11-24&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;04:29 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Lundin on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-11-24&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;04:30 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2009 23:28:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-NV-Memory-writing/m-p/156755#M4079</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2009-11-24T23:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Flash/NV Memory writing</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-NV-Memory-writing/m-p/156756#M4080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The amount of code presently written for this application is small, but the IO is pretty much maxed out (so external EEPROM not easily implemented).&amp;nbsp; I noticed the NVRAM registers.&amp;nbsp; Is there an easy way to write to these?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2009 23:34:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-NV-Memory-writing/m-p/156756#M4080</guid>
      <dc:creator>danes</dc:creator>
      <dc:date>2009-11-24T23:34:11Z</dc:date>
    </item>
  </channel>
</rss>

