<?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 Stop Mode2: Problem restoring I/O pins after wake-up</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166513#M10635</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;For the 9S08QD2 device, the address range starting at 0x1000 is actually unimplemented.&amp;nbsp; You will need to place the RAM data somewhere within the range 0x0080 to 0x00FF, and possibly not too high within this range to allow sufficient room for the stack, with an upper address of 0x00FF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Jan 2010 18:13:32 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2010-01-17T18:13:32Z</dc:date>
    <item>
      <title>HCS08 Stop Mode2: Problem restoring I/O pins after wake-up</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166511#M10633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm working on a project with MC9S08QD2. The CPU awake from stop mode 2 from a free count RTI every 250ms. After waking up the processor should restore the output I/O pins and check input pins before going to sleep again. My problem is how I can restore the I/Os after waking up. I know that I have to store the I/O status in RAM before going to sleep. I added this code in .prm file:&lt;/P&gt;&lt;PRE&gt;
SECTIONSSOME_CONSTANTS = READ_ONLY 0x1000 TO 0x1010; /* RAM area */ENDPLACEMENTMY_CONSTANTS INTO SOME_CONSTANTS;END&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and this in my .c file:&lt;/P&gt;&lt;PRE&gt;
#pragma CONST_SEG MY_CONSTANTSvolatile int store_IO; /* place in global namespace */#pragma CONST_SEG DEFAULT&lt;/PRE&gt;&lt;P&gt;It seems that the the variable is not stored in RAM correctly. Can anyone help me out there? Some sample code would be help much. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:13:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166511#M10633</guid>
      <dc:creator>patrickk</dc:creator>
      <dc:date>2020-10-29T09:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Stop Mode2: Problem restoring I/O pins after wake-up</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166512#M10634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see two issues.&lt;/P&gt;&lt;P&gt;First in the PRM file the "SOME_CONSTANTS" segment is defined as READ_ONLY.&lt;/P&gt;&lt;P&gt;As it ends up in RAM I don't think this is what you want. Basically READ_ONLY means that it is programmed at flashing time (with a programmer, or even placed in a real ROM).&lt;/P&gt;&lt;P&gt;For content in RAM either user READ_WRITE if the content should be initialized by the startup code or&amp;nbsp;&lt;/P&gt;&lt;P&gt;NO_INIT if the startup code should not touch it.&lt;/P&gt;&lt;P&gt;E.g.:&lt;/P&gt;&lt;PRE&gt;SOME_CONSTANTS = &lt;SPAN&gt;NO_INIT&lt;/SPAN&gt; 0x1000 TO 0x1010; /* RAM area */&lt;/PRE&gt;&lt;P&gt;The second issue is that a #pragma CONST_SEG applies to constants, but the variable shown is not const.&lt;/P&gt;&lt;P&gt;So use a #pragma DATA_SEG (or make the variable const if the variable really does not change) .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#pragma &lt;SPAN&gt;DATA_SEG&lt;/SPAN&gt; MY_CONSTANTS

volatile int store_IO; /* place in global namespace */

#pragma CONST_SEG DEFAULT&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#pragma CONST_SEG MY_CONSTANTS
&lt;SPAN&gt;const&lt;/SPAN&gt; volatile int store_IO = 0; /* place in global namespace */
#pragma CONST_SEG DEFAULT&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:13:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166512#M10634</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2020-10-29T09:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Stop Mode2: Problem restoring I/O pins after wake-up</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166513#M10635</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;For the 9S08QD2 device, the address range starting at 0x1000 is actually unimplemented.&amp;nbsp; You will need to place the RAM data somewhere within the range 0x0080 to 0x00FF, and possibly not too high within this range to allow sufficient room for the stack, with an upper address of 0x00FF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jan 2010 18:13:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166513#M10635</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-01-17T18:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 Stop Mode2: Problem restoring I/O pins after wake-up</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166514#M10636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Many thanks to you both for helping me out. I appreciate it. Sometimes the easiest things remain unnoticed. I've changed the constant to a data variable and changed the RAM adress. Now it is working perfectly.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 00:03:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-Stop-Mode2-Problem-restoring-I-O-pins-after-wake-up/m-p/166514#M10636</guid>
      <dc:creator>patrickk</dc:creator>
      <dc:date>2010-01-20T00:03:35Z</dc:date>
    </item>
  </channel>
</rss>

