<?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: HCS08 SGF Driver Rountines</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129861#M2213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Rocco,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For basic flash programming, the driver needs only 1 routine in ram and only uses 25 bytes.&lt;/DIV&gt;&lt;DIV&gt;Here is what I did:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Added a segment in the PRM file for the routine:&lt;/DIV&gt;&lt;DIV&gt;SEGMENTS&lt;/DIV&gt;&lt;DIV&gt;RAM1&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; READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0100 TO 0x0125;&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;PLACEMENT&lt;/DIV&gt;&lt;DIV&gt;FLASH_ROUTINES&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; INTO&amp;nbsp; RAM1;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Put ORG $100 within the assembly source file for the assembly routine supplied with the driver&lt;/DIV&gt;&lt;DIV&gt;ORG&amp;nbsp;&amp;nbsp; $100&lt;BR /&gt;&amp;nbsp;XDEF HighVoltage&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Put a #prama&amp;nbsp;in the header of the assembly routine&lt;/DIV&gt;&lt;DIV&gt;#pragma CODE_SEG FLASH_ROUTINES&lt;BR /&gt;UINT8 HighVoltage (void);&lt;BR /&gt;#pragma CODE_SEG DEFAULT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The srecord is supplied for the assembly file.&amp;nbsp; Is there way link the srecord and place it in RAM1 rather than ORG $100?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Sep 2006 10:54:18 GMT</pubDate>
    <dc:creator>FC</dc:creator>
    <dc:date>2006-09-12T10:54:18Z</dc:date>
    <item>
      <title>HCS08 SGF Driver Rountines</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129858#M2210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am trying to use the HCS08 SGF flash driver routines, but would like some input to copy the HighVoltage function from flash to ram.&amp;nbsp; Is there a way to dynamically copy it and save ram when no flash programming is needed?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2006 03:20:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129858#M2210</guid>
      <dc:creator>FC</dc:creator>
      <dc:date>2006-09-11T03:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 SGF Driver Rountines</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129859#M2211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, FC:&lt;BR /&gt;&lt;BR /&gt;I have done it two ways.&lt;BR /&gt;&lt;BR /&gt;In one application, programming the flash and having the firmware operating was mutually exclusive. So I used equates to overlay my operating data with the flash-programming routines and data. So the flash routines had no ram footprint at all, except when in programming mode.&lt;BR /&gt;&lt;BR /&gt;In another application, I had a page of flash dedicated to operating parameters. These had to be changed occasionally while the firmware was running. For this, I used code from an app-note, which pushed the routine onto the stack, and ran it there. I will try to find that app-note.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2006 05:45:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129859#M2211</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-09-11T05:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 SGF Driver Rountines</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129860#M2212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi again:&lt;BR /&gt;&lt;BR /&gt;The app-note is old, as it was originally written for the GP32. It copies the high-voltage routines onto the stack, and runs them there. For the GP32, it needs 80 bytes of stack. It will probably be less for the S08 family, due to the embedded state-machine.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN2183.pdf" rel="nofollow" target="_blank"&gt;http://www.freescale.com/files/microcontrollers/doc/app_note/AN2183.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;(Alban formatted link)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Alban on &lt;SPAN class="date_text"&gt;2006-09-11&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:06 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2006 06:07:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129860#M2212</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-09-11T06:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 SGF Driver Rountines</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129861#M2213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Rocco,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For basic flash programming, the driver needs only 1 routine in ram and only uses 25 bytes.&lt;/DIV&gt;&lt;DIV&gt;Here is what I did:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Added a segment in the PRM file for the routine:&lt;/DIV&gt;&lt;DIV&gt;SEGMENTS&lt;/DIV&gt;&lt;DIV&gt;RAM1&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; READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0100 TO 0x0125;&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;PLACEMENT&lt;/DIV&gt;&lt;DIV&gt;FLASH_ROUTINES&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; INTO&amp;nbsp; RAM1;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Put ORG $100 within the assembly source file for the assembly routine supplied with the driver&lt;/DIV&gt;&lt;DIV&gt;ORG&amp;nbsp;&amp;nbsp; $100&lt;BR /&gt;&amp;nbsp;XDEF HighVoltage&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Put a #prama&amp;nbsp;in the header of the assembly routine&lt;/DIV&gt;&lt;DIV&gt;#pragma CODE_SEG FLASH_ROUTINES&lt;BR /&gt;UINT8 HighVoltage (void);&lt;BR /&gt;#pragma CODE_SEG DEFAULT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The srecord is supplied for the assembly file.&amp;nbsp; Is there way link the srecord and place it in RAM1 rather than ORG $100?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2006 10:54:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129861#M2213</guid>
      <dc:creator>FC</dc:creator>
      <dc:date>2006-09-12T10:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 SGF Driver Rountines</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129862#M2214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello FC,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;It is unclear what you are trying to achieve with the use of the SGF flash driver routines.&amp;nbsp; I initially suspected you required to store data in flash during normal operation of your firmware program - is this the situation?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;On this assumption, your program would need to store the high voltage routine in flash, and then provide a simple routine to copy this code to RAM just prior to any data flash programming.&amp;nbsp; So the S19 file should not use address location 0x0100 (start of RAM1 segment) for the placement of any code, because it is not a flash block, and is volatile.&amp;nbsp; ORG $100 would only define the start address when the high voltage routine commences execution.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; XDEF&amp;nbsp; HighVoltage&amp;nbsp; ; Provide label visibility outside current file&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; ORG&amp;nbsp;&amp;nbsp; $100&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;HighVoltage:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; Define label&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;or alternatively,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;HighVoltage&amp;nbsp; equ&amp;nbsp; $100&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Here is a snippet of code for the copy process, where flash location HVcode contains the code to be executed from RAM&amp;nbsp;-&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;HVcode:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dc.b&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;; Sequence of bytes for HighVoltage routine&lt;BR /&gt;; etc.&lt;BR /&gt;&lt;BR /&gt;Copy_code:&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx&amp;nbsp; #25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; Number of bytes to copy&lt;BR /&gt;loop1:&amp;nbsp;lda&amp;nbsp;&amp;nbsp; HVcode-1,x&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sta&amp;nbsp;&amp;nbsp; HighVoltage-1,x&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbnzx loop1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rts&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2006 12:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129862#M2214</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-09-12T12:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 SGF Driver Rountines</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129863#M2215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;I'm pretty late on this thread, but I just wanted to place a working project that does it for future reference...&lt;/DIV&gt;&lt;DIV&gt;Here's a project for a GB/GT S08, that stores the flash program routines in Flash, but has a copydown in the Start08.c that copies this function into RAM.&amp;nbsp; It also modifies the PRM so that the debug info for the flash routines are now linked to the RAM location where it was sent to..&lt;/DIV&gt;&lt;DIV&gt;the project was built for CW 5.1, but shouldn't be hard to modify it for later versions.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;hope this helps!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://www.freescale.com/files/community_files/8BITCOMM/12326_s08_flash.zip" rel="nofollow" target="_self"&gt;S08_Flash.zip&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-27&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:03 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2008 22:14:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SGF-Driver-Rountines/m-p/129863#M2215</guid>
      <dc:creator>fleik</dc:creator>
      <dc:date>2008-10-20T22:14:08Z</dc:date>
    </item>
  </channel>
</rss>

