<?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>8-bit Microcontrollers中的主题 Re: Flash Writing and Erasing for the MC9S08QG8</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140665#M5707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;kdelbarba coded:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;if (FSTAT_FACCERR)&lt;BR /&gt;{&lt;BR /&gt;FSTAT_FACCERR = &lt;B&gt;0&lt;/B&gt;; // clearing Error Field&lt;BR /&gt;}&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;According to page 55:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;FACCERR is cleared by writing a 1 to FACCERR. Writing a 0 to FACCERR has no meaning or effect.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jul 2006 00:06:23 GMT</pubDate>
    <dc:creator>irob</dc:creator>
    <dc:date>2006-07-06T00:06:23Z</dc:date>
    <item>
      <title>Flash Writing and Erasing for the MC9S08QG8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140662#M5704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've read all the previous topics related to this and have not found one to help. Right now I'm trying to write single bytes to Flash and erase pages in flash. I've written a function that seems to work when using single step but if I just let it run the flash isn't written to or erased. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void WriteToFlash(char charinput, int address, short erase)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; char *write;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; int done;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; write = (char * )address; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (1 == FSTAT_FACCERR)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FSTAT_FACCERR = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } // end if // clearing Error Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; while (0 == FSTAT_FCBEF)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; feedCOP();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } // end while // FCBEF Command buffer empty flag 1 means it's empty&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; *write = charinput; // load into buffer address and char going to write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (0 == erase) // write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FCMD = 0x20; // write one byte&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } // end if &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FCMD = 0x40; // erase page the byte would be in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } // end erase else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FSTAT_FCBEF = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; asm&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MUL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (FSTAT_FACCERR == 1 | FSTAT_FPVIOL == 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; SendMsg("Error!!!!!!"); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FSTAT_FCBEF = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } // end write to flash&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kdelbarba&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 23:10:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140662#M5704</guid>
      <dc:creator>kdelbarba</dc:creator>
      <dc:date>2006-06-22T23:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Writing and Erasing for the MC9S08QG8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140663#M5705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello kdelbarba.&lt;BR /&gt;I think you need to run the page-erase and byte-write functions in ram because flash is disabled during the process (so your program can't run...).&lt;BR /&gt;Also, I don't see where you initialize the flash clock divider, etc.&lt;BR /&gt;Look up application notes regarding 'Do-on-stack' which is a freescale flash-write routine.&lt;BR /&gt;ron&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 07:13:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140663#M5705</guid>
      <dc:creator>glork</dc:creator>
      <dc:date>2006-06-23T07:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Writing and Erasing for the MC9S08QG8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140664#M5706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;i agree with you glork .We shouldrun the WRITE and ERASE code in RAM.&lt;/P&gt;&lt;P&gt;You have to copy the code to RAM and rin it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 16:55:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140664#M5706</guid>
      <dc:creator>fire</dc:creator>
      <dc:date>2006-07-04T16:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Writing and Erasing for the MC9S08QG8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140665#M5707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;kdelbarba coded:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;if (FSTAT_FACCERR)&lt;BR /&gt;{&lt;BR /&gt;FSTAT_FACCERR = &lt;B&gt;0&lt;/B&gt;; // clearing Error Field&lt;BR /&gt;}&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;According to page 55:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;FACCERR is cleared by writing a 1 to FACCERR. Writing a 0 to FACCERR has no meaning or effect.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 00:06:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140665#M5707</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-07-06T00:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Writing and Erasing for the MC9S08QG8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140666#M5708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;kdelbarba, have you &lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=1755#M1755" target="_blank"&gt;seen this post&lt;/A&gt;? It's a great tech note with sample code on copying a function from flash to RAM and then running the function from RAM. Works nicely with your function.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 01:53:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140666#M5708</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-07-06T01:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Writing and Erasing for the MC9S08QG8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140667#M5709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Irob,&lt;/P&gt;&lt;P&gt;&amp;nbsp; You mentioned page 55 on this forum.. the question is.. what note/document are you accessing?&amp;nbsp; I plan to implement a flash page erase function as part of my application using a gt16.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bud&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 06:02:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140667#M5709</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2006-07-12T06:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Writing and Erasing for the MC9S08QG8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140668#M5710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Sorry about that. I was referring to the MC9S08QG8 datasheet: &lt;A href="http://www.freescale.com/files/microcontrollers/doc/data_sheet/MC9S08QG8.pdf" rel="nofollow" target="_blank"&gt;LINK&lt;/A&gt;.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 06:08:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Writing-and-Erasing-for-the-MC9S08QG8/m-p/140668#M5710</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-07-12T06:08:29Z</dc:date>
    </item>
  </channel>
</rss>

