<?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 code for JM60</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194539#M15437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bob &amp;amp; Peg&lt;/P&gt;&lt;P&gt;I have enough to go on with now. I need to alter one or more bytes in a block,&lt;/P&gt;&lt;P&gt;so will copy the flash block to Ram, modify the ram bytes &amp;amp; flash it back to Flash&lt;/P&gt;&lt;P&gt;using the block flash command.&lt;/P&gt;&lt;P&gt;One would think FS would have demo code of these commonly required tasks available....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 Jul 2009 07:51:39 GMT</pubDate>
    <dc:creator>donw</dc:creator>
    <dc:date>2009-07-05T07:51:39Z</dc:date>
    <item>
      <title>FLASH programming code for JM60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194536#M15434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Does someone have the code (prefer assembly code)&lt;/P&gt;&lt;P&gt;for flashing data to a byte or block&amp;nbsp; of flash in a JM60 ?&lt;/P&gt;&lt;P&gt;I dont need anything fancy, just code that runs in RAM with interrupts disabled&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I have looked at the USB bootloader samples, but the flash code is hidden in a library...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2009 09:40:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194536#M15434</guid>
      <dc:creator>donw</dc:creator>
      <dc:date>2009-06-27T09:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: FLASH programming code for JM60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194537#M15435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Don,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=8121&amp;amp;query.id=8244#M8121" target="_blank"&gt;This&lt;/A&gt; should get you started. Should still work with JM apart from any paging type issues .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2009 12:12:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194537#M15435</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2009-06-27T12:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: FLASH programming code for JM60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194538#M15436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using this in a JM60 project,&amp;nbsp; its an adaptation to the Mini-RAM routines posted in this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
const unsigned char ROM_PGM[7]  = {  0xf7,                // sta ,X      FSTAT  0x44,               // lsra -  delay and convert to FCCF bit0xf5,               // Bit X ,fstat0xf5,               // Bit X ,fstat0x27,0xfd,          // BEQ *-10x81                // RTS}; volatile unsigned char PGM[7]  = {  0xf7,                // sta ,X      FSTAT  0x44,               // lsra -  delay and convert to FCCF bit0xf5,               // Bit X ,fstat0xf5,               // Bit X ,fstat0x27,0xfd,          // BEQ *-10x81                // RTS}; void InitFlashRoutine(void)    // match number of bytes above.  {  PGM[0] = ROM_PGM[0];  PGM[1] = ROM_PGM[1];  PGM[2] = ROM_PGM[2];  PGM[3] = ROM_PGM[3];  PGM[4] = ROM_PGM[4];  PGM[5] = ROM_PGM[5];  PGM[6] = ROM_PGM[6];    }byte FlashErasePage(word page) {      asm {      TPA         ; Get status to A      PSHA        ; Save current status        SEI         ; Disable interrupts      LDA  #0x30      STA  FSTAT  ; Clear FACCERR &amp;amp; FPVIOL flags      LDHX  page      STA ,X      ; Save the data      LDA  #$40   ; Erase command      STA  FCMD      LDA  #FSTAT_FCBEF_MASK      LDHX @FSTAT       JSR  PGM      PULA        ; Restore previous status      TAP   }     return (FSTAT &amp;amp; 0x30);  }byte FlashProgramByte(word address, byte data) {      asm{      TPA        PSHA        ; Save current status        SEI         ; Disable interrupts      LDA  #0x30      STA  FSTAT  ; Clear FACCERR &amp;amp; FPVIOL flags      LDHX  address      LDA  data      STA ,X      ; Save the data      LDA  #$20   ; Burn command      STA  FCMD      LDA  #FSTAT_FCBEF_MASK      LDHX @FSTAT       JSR   PGM      PULA        ; Restore previous status      TAP      }     return (FSTAT &amp;amp; 0x30);  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:48:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194538#M15436</guid>
      <dc:creator>TurboBob</dc:creator>
      <dc:date>2020-10-29T09:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: FLASH programming code for JM60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194539#M15437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bob &amp;amp; Peg&lt;/P&gt;&lt;P&gt;I have enough to go on with now. I need to alter one or more bytes in a block,&lt;/P&gt;&lt;P&gt;so will copy the flash block to Ram, modify the ram bytes &amp;amp; flash it back to Flash&lt;/P&gt;&lt;P&gt;using the block flash command.&lt;/P&gt;&lt;P&gt;One would think FS would have demo code of these commonly required tasks available....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2009 07:51:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194539#M15437</guid>
      <dc:creator>donw</dc:creator>
      <dc:date>2009-07-05T07:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: FLASH programming code for JM60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194540#M15438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my&amp;nbsp; opinion,&amp;nbsp; there is a lot of demo code that FS should have published.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may want to consider using 2 blocks.&amp;nbsp; Copy block A to RAM,&amp;nbsp; change the bytes you want, then erase and program block B.&amp;nbsp; Then you can work out a recovery plan in case of a reset in the middle of the operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2009 07:58:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194540#M15438</guid>
      <dc:creator>TurboBob</dc:creator>
      <dc:date>2009-07-05T07:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: FLASH programming code for JM60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194541#M15439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes its always a good idea to have a recovery plan!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2009 08:12:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/FLASH-programming-code-for-JM60/m-p/194541#M15439</guid>
      <dc:creator>donw</dc:creator>
      <dc:date>2009-07-05T08:12:09Z</dc:date>
    </item>
  </channel>
</rss>

