<?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 Programming Examples</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124312#M265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I made mistake&lt;BR /&gt;&lt;BR /&gt;STA FCDIV ;flash clk freq divider setup ((fosc)/200000)-1&lt;BR /&gt;&lt;BR /&gt;should be&lt;BR /&gt;&lt;BR /&gt;STA FCDIV ;flash clk freq divider setup ((fbus)/200000)-1&lt;BR /&gt;&lt;BR /&gt;and the FCDIV should be recalculated.&lt;BR /&gt;&lt;BR /&gt;Ah, those clocks...&lt;P&gt;Message Edited by Andik on &lt;SPAN class="date_text"&gt;2006-07-19&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;04:00 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2006 15:57:36 GMT</pubDate>
    <dc:creator>Andik</dc:creator>
    <dc:date>2006-07-19T15:57:36Z</dc:date>
    <item>
      <title>Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124308#M261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are there any GOOD examples of programming flash. I have found the document in the GT60UG that has an example but its pretty confusing and not much help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2006 00:58:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124308#M261</guid>
      <dc:creator>mjcoury</dc:creator>
      <dc:date>2006-07-18T00:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124309#M262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hope, the FCLKDIV is right...&lt;BR /&gt;&lt;BR /&gt;;initialisation for RG60 @ 8MHz&lt;BR /&gt;LDA #19&lt;BR /&gt;STA FCDIV ;flash clk freq divider setup ((fosc)/200000)-1&lt;BR /&gt;LDA #$30&lt;BR /&gt;STA FSTAT ;clear errors&lt;BR /&gt;LDA #$F8&lt;BR /&gt;STA FPROT ;unprotect&lt;BR /&gt;&lt;BR /&gt;;subroutine for program HCS08 byte,&lt;BR /&gt;;input data and address on stack&lt;BR /&gt;&lt;BR /&gt;PROG:&lt;BR /&gt; PSHA ;save data&lt;BR /&gt; PSHX ;save Lo(addr)&lt;BR /&gt; PSHH ;save Hi(addr)&lt;BR /&gt; LDHX #FSTAT&lt;BR /&gt; FCBEF:&lt;BR /&gt; LDA ,X&lt;BR /&gt; AND #$80 ;FCBEF bit&lt;BR /&gt; BEQ FCBEF ;wait until command buffer empty&lt;BR /&gt; PULH&lt;BR /&gt; PULX&lt;BR /&gt; PULA&lt;BR /&gt; STA ,X ;write desired data to desired address&lt;BR /&gt; AIX #1&lt;BR /&gt;&lt;BR /&gt; PSHX&lt;BR /&gt; PSHH&lt;BR /&gt; LDHX #FCMD&lt;BR /&gt; LDA #$25 ;BURST_PGM command code&lt;BR /&gt; STA ,X ;write PGM command&lt;BR /&gt; LDHX #FSTAT&lt;BR /&gt; LDA #$80 ;FCBEF bit&lt;BR /&gt; STA ,X ;start command execution&lt;BR /&gt; PULH&lt;BR /&gt; PULX&lt;BR /&gt;&lt;BR /&gt;RTS&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;Andik&lt;/B&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2006 20:38:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124309#M262</guid>
      <dc:creator>Andik</dc:creator>
      <dc:date>2006-07-18T20:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124310#M263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks for the example!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now how do you reserve memory in codewarrior on the MCU so that you don't overwrite the program?? I want to reserve the ~60K space from $182C - $FFBD? for fonts and other bitmaps... I am not running PE as this is the evolution of a example program from freescale.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Mike&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 03:31:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124310#M263</guid>
      <dc:creator>mjcoury</dc:creator>
      <dc:date>2006-07-19T03:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124311#M264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;mjcoury wrote:&lt;BR /&gt;how do you reserve memory in codewarrior on the MCU so that you don't overwrite the program?? I want to reserve the ~60K space from $182C - $FFBD?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Mike, put this in your .prm file which is in Project Settings \ Linker CW folder. Place it inside the SEGMENTS section:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;YOUR_MEMORY = READ_ONLY 0x182C TO 0xFFBD&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Then place this inside the PLACEMENT section:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;YOUR_MEMORY_SPACE INTO YOUR_MEMORY;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Then in your .c file, put this in front of the routines that are to be located there:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;#pragma CODE_SEG YOUR_MEMORY_SPACE&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Hope that helps.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 05:48:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124311#M264</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-07-19T05:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124312#M265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I made mistake&lt;BR /&gt;&lt;BR /&gt;STA FCDIV ;flash clk freq divider setup ((fosc)/200000)-1&lt;BR /&gt;&lt;BR /&gt;should be&lt;BR /&gt;&lt;BR /&gt;STA FCDIV ;flash clk freq divider setup ((fbus)/200000)-1&lt;BR /&gt;&lt;BR /&gt;and the FCDIV should be recalculated.&lt;BR /&gt;&lt;BR /&gt;Ah, those clocks...&lt;P&gt;Message Edited by Andik on &lt;SPAN class="date_text"&gt;2006-07-19&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;04:00 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 15:57:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124312#M265</guid>
      <dc:creator>Andik</dc:creator>
      <dc:date>2006-07-19T15:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124313#M266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Is it reccomended to do all of this in ASM verses C?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2006 02:57:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124313#M266</guid>
      <dc:creator>mjcoury</dc:creator>
      <dc:date>2006-07-20T02:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124314#M267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;With all the fine examples here on the boards, I did mine in C.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2006 03:07:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124314#M267</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-07-20T03:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124315#M268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;These posts are great help all.... last question for the moment.... if this is written in C how exactly to load the registers and push data onto the stack in C code? or is that no possible?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;MC&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 20:55:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124315#M268</guid>
      <dc:creator>mjcoury</dc:creator>
      <dc:date>2006-07-21T20:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124316#M269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm just running my flash writing code from RAM instead of the stack. Seems to work well enough for my needs. &lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=1755#M1755" target="_blank"&gt;Have you 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.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 22:46:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124316#M269</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-07-21T22:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124317#M270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Ahh glorious - i will check this out post haste...&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 23:10:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124317#M270</guid>
      <dc:creator>mjcoury</dc:creator>
      <dc:date>2006-07-21T23:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming Examples</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124318#M271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Another example of writing to FLASH.&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=1346" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=1346&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Jul 2006 00:01:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Flash-Programming-Examples/m-p/124318#M271</guid>
      <dc:creator>Technoman64</dc:creator>
      <dc:date>2006-07-22T00:01:42Z</dc:date>
    </item>
  </channel>
</rss>

