<?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: simulate Flash write with CW in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153676#M8619</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi zen,&lt;BR /&gt;&lt;BR /&gt;FLASH memory is a type of ROM in that you cannot simply write to it (say with STA) and the value is retained there. This is only useful with RAM where it will remain as long as it is powered.&lt;BR /&gt;It is not ROM in that you can write to it but only using special techniques and only after a section (page) is erased first. Refer to the FLASH Memory chapter in the GP32 datasheet.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 May 2008 17:31:46 GMT</pubDate>
    <dc:creator>peg</dc:creator>
    <dc:date>2008-05-07T17:31:46Z</dc:date>
    <item>
      <title>simulate Flash write with CW - HC08908GP32</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153675#M8618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hi, all&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;I am using cw to learn some assembly instrcutions.&amp;nbsp;I&amp;nbsp;chose&amp;nbsp;HC08908GP32 device&amp;nbsp; When I write to an address in flash. CW reported an&amp;nbsp;Error that&amp;nbsp;"Attempt to write to ROM."&amp;nbsp; Does flash equals ROM? my code is as follows:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; test IX addressing mode&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lda #10&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx #$A010&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sta ,x&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;the report of Error occured at&amp;nbsp;the&amp;nbsp;last line, " sta ,x"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;DIV&gt;zen&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Added p/n to subject.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by NLFSJ on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-05-07&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;07:35 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 15:58:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153675#M8618</guid>
      <dc:creator>zen</dc:creator>
      <dc:date>2008-05-07T15:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: simulate Flash write with CW</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153676#M8619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi zen,&lt;BR /&gt;&lt;BR /&gt;FLASH memory is a type of ROM in that you cannot simply write to it (say with STA) and the value is retained there. This is only useful with RAM where it will remain as long as it is powered.&lt;BR /&gt;It is not ROM in that you can write to it but only using special techniques and only after a section (page) is erased first. Refer to the FLASH Memory chapter in the GP32 datasheet.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 17:31:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153676#M8619</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-05-07T17:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: simulate Flash write with CW</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153677#M8620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;thanks, peg&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; After reading your reply,&amp;nbsp; I reviewed&amp;nbsp;a textbook on digital circuit and searched on google. Due to the physical principle of Flash Memory,&amp;nbsp;wrtting a memory cell is accomplished by first applying a required high voltage (programming voltage) to the cell,&amp;nbsp;then write the data.&amp;nbsp;GP32 contains a charge pump which is capable of&amp;nbsp;produce&amp;nbsp;the required high voltage&amp;nbsp;from its normal voltage, the charge pump is controlled through programming. Under normal voltage, the memory cell is read-only.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As far as programming is concerned, Flash memory puts a contraint on program structure design. For example, you cannot store&amp;nbsp;a constant in Flash use " sta &amp;lt;flash address&amp;gt;..",&amp;nbsp;instead, you can use&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORG&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;flash address&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;ConInFlash:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DC.B&amp;nbsp;&amp;nbsp; &amp;lt;constant&amp;gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;when &lt;STRONG&gt;programming&lt;/STRONG&gt; the device, the&amp;nbsp;&amp;lt;constant&amp;gt; is written to the flash address&amp;nbsp;&amp;lt;flash address&amp;gt;.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Best Regards&lt;/DIV&gt;&lt;DIV&gt;zen&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 10:34:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153677#M8620</guid>
      <dc:creator>zen</dc:creator>
      <dc:date>2008-05-08T10:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: simulate Flash write with CW</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153678#M8621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi zen,&lt;BR /&gt;&lt;BR /&gt;What you have described is how to place constants in flash along with the programme code when you originally programme the device.&lt;BR /&gt;What I thought you were trying to do was write to flash during execution of your programme, therefore I referred you to the FLASH programming chapter in the datasheet.&lt;BR /&gt;This way you can treat some of the flash memory as EEPROM and use it for storing data that needs to be retained through power down periods but which is not known at original programming time (i.e. some kind of calibration data that has to be carried out periodically to allow for drift etc).&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 10:50:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153678#M8621</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-05-08T10:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: simulate Flash write with CW</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153679#M8622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;hi, peg:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;Thanks for reminding. I&amp;nbsp;really did not realize that the data produced during the execuation of my program can be stored in flash. I read the Flash Memory chapter and my understraning is that, to store data in flash during the execuation of program, the &lt;STRONG&gt;FLASH Block Protect Register&lt;/STRONG&gt; must be set &lt;STRONG&gt;first&lt;/STRONG&gt; during the &lt;STRONG&gt;programming&lt;/STRONG&gt; of the device. Then, writting data to flash during the execuation of program is&amp;nbsp;achievable if&amp;nbsp;the necessary procedures for programming flash are followed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;zen&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 13:56:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/simulate-Flash-write-with-CW-HC08908GP32/m-p/153679#M8622</guid>
      <dc:creator>zen</dc:creator>
      <dc:date>2008-05-08T13:56:45Z</dc:date>
    </item>
  </channel>
</rss>

