<?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のトピックVariable initialization in EEPROM at Compile Time</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Variable-initialization-in-EEPROM-at-Compile-Time/m-p/173539#M11873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a user of the 8-bit HCS08 microprocessors (in this project I'm using the HCS08DZ60A).&amp;nbsp; Does anyone know of a technique where I can initialize a variable that's declared in EEPROM at compile time?&amp;nbsp; In other words, I'd like to do something like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG&amp;nbsp;&amp;nbsp;&amp;nbsp; _EEPROM&lt;BR /&gt;// Variable initialized during compile.&amp;nbsp;&lt;BR /&gt;volatile unsigned char eeprom_byte = 0xAB;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that after programming the microprocessor, the variable eeprom_byte is initialized to value 0xAB.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to accomplish is a method for detecting a 'virgin load' of the firmware into the micro, and store the status in this byte.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks much,&lt;/P&gt;&lt;P&gt;~Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Feb 2010 04:55:13 GMT</pubDate>
    <dc:creator>belskyc</dc:creator>
    <dc:date>2010-02-06T04:55:13Z</dc:date>
    <item>
      <title>Variable initialization in EEPROM at Compile Time</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Variable-initialization-in-EEPROM-at-Compile-Time/m-p/173539#M11873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a user of the 8-bit HCS08 microprocessors (in this project I'm using the HCS08DZ60A).&amp;nbsp; Does anyone know of a technique where I can initialize a variable that's declared in EEPROM at compile time?&amp;nbsp; In other words, I'd like to do something like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG&amp;nbsp;&amp;nbsp;&amp;nbsp; _EEPROM&lt;BR /&gt;// Variable initialized during compile.&amp;nbsp;&lt;BR /&gt;volatile unsigned char eeprom_byte = 0xAB;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that after programming the microprocessor, the variable eeprom_byte is initialized to value 0xAB.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to accomplish is a method for detecting a 'virgin load' of the firmware into the micro, and store the status in this byte.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks much,&lt;/P&gt;&lt;P&gt;~Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2010 04:55:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Variable-initialization-in-EEPROM-at-Compile-Time/m-p/173539#M11873</guid>
      <dc:creator>belskyc</dc:creator>
      <dc:date>2010-02-06T04:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Variable initialization in EEPROM at Compile Time</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Variable-initialization-in-EEPROM-at-Compile-Time/m-p/173540#M11874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;looks like that accidentally the same question has already been answered in the following thread: &lt;A href="http://forums.freescale.com/../../freescale/board/message?board.id=8BITCOMM&amp;amp;thread.id=15738" rel="nofollow" target="_self" title="Linkification: http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;thread.id=15738"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;thread.id=15738&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2010 06:09:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Variable-initialization-in-EEPROM-at-Compile-Time/m-p/173540#M11874</guid>
      <dc:creator>ok2ucx</dc:creator>
      <dc:date>2010-02-06T06:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variable initialization in EEPROM at Compile Time</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Variable-initialization-in-EEPROM-at-Compile-Time/m-p/173541#M11875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that the key is that the segment used in the prm file must be using the READ_ONLY type,&lt;/P&gt;&lt;P&gt;not that the variable is const. I would actually make the variable const as the varible is not writable with a simple write, but as far as the tools are concerned they do not insist.&lt;/P&gt;&lt;P&gt;Everything in a READ_ONLY segment gets programmed at download time, everything in a READ_WRITE segment gets initialized during program startup (and everything in a NO_INIT or PAGED segment does not get initialized automatically at all).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2010 08:15:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Variable-initialization-in-EEPROM-at-Compile-Time/m-p/173541#M11875</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2010-02-06T08:15:07Z</dc:date>
    </item>
  </channel>
</rss>

