<?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>topic Re: Is RAM value equal to 0x00 when power up? in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210682#M8714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;ISO C states that variables with static storage duration (that is, global and static variables) must be set to zero before the program is started, unless they are explicitly initialized by the programmer. It also states that variables with automatic storage duration (local variables) will have a random value at startup.&lt;BR /&gt;&lt;BR /&gt;So this isn't something that the Freescale docs need to mention, the C programming standard is clear. Assuming of course that the compiler follows ISO C, which Codewarrior does as long as the startup file is executed.&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;&lt;BR /&gt;Codewarrior does not clear NO_INIT segments, so it is possible to preserve variables in RAM after a reset, assuming that the reset wasn't a power-on reset. With the S12 you can check if the reset was caused by the COP, clock failure or power-on. If the cause was the COP, one can assume that the RAM is still intact.&lt;BR /&gt;&lt;BR /&gt;The best solution is indeed to do as already mentioned: store the variable in non-volatile memory.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Apr 2008 14:52:30 GMT</pubDate>
    <dc:creator>Lundin</dc:creator>
    <dc:date>2008-04-10T14:52:30Z</dc:date>
    <item>
      <title>Is RAM value equal to 0x00 when power up?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210680#M8712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;MC9S12D32 question...&lt;/DIV&gt;&lt;DIV&gt;I want a reset counter in my program for reading the reset counts. But&amp;nbsp;I'm not sure whether the RAM is 0-init when power up. Certainly, I know&amp;nbsp;the start.c file will clear RAM for global variables, but it will not clear the NO-INIT RAM. I can't find any information about this in freescale's documents. Anybody can help?&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 00:14:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210680#M8712</guid>
      <dc:creator>patacCooper</dc:creator>
      <dc:date>2008-04-09T00:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is RAM value equal to 0x00 when power up?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210681#M8713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;From the mcu's point of view, reset does not affect ram.&lt;BR /&gt;&lt;BR /&gt;Of course from a power down, ram is random data.&lt;BR /&gt;If you truly need a persistent reset counter, you need to write it EEPROM or flash, otherwise it will be lost of power is lost.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 02:37:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210681#M8713</guid>
      <dc:creator>JeffS_</dc:creator>
      <dc:date>2008-04-09T02:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is RAM value equal to 0x00 when power up?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210682#M8714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;ISO C states that variables with static storage duration (that is, global and static variables) must be set to zero before the program is started, unless they are explicitly initialized by the programmer. It also states that variables with automatic storage duration (local variables) will have a random value at startup.&lt;BR /&gt;&lt;BR /&gt;So this isn't something that the Freescale docs need to mention, the C programming standard is clear. Assuming of course that the compiler follows ISO C, which Codewarrior does as long as the startup file is executed.&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;&lt;BR /&gt;Codewarrior does not clear NO_INIT segments, so it is possible to preserve variables in RAM after a reset, assuming that the reset wasn't a power-on reset. With the S12 you can check if the reset was caused by the COP, clock failure or power-on. If the cause was the COP, one can assume that the RAM is still intact.&lt;BR /&gt;&lt;BR /&gt;The best solution is indeed to do as already mentioned: store the variable in non-volatile memory.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2008 14:52:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210682#M8714</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-04-10T14:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is RAM value equal to 0x00 when power up?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210683#M8715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;JeffS, thanks for your helpful suggestion.&lt;/DIV&gt;&lt;DIV&gt;And Lundin, you are very kind.&amp;nbsp;I guess it takes&amp;nbsp;not a short time to present the background information. Thank you very much.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2008 21:07:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Is-RAM-value-equal-to-0x00-when-power-up/m-p/210683#M8715</guid>
      <dc:creator>patacCooper</dc:creator>
      <dc:date>2008-04-10T21:07:58Z</dc:date>
    </item>
  </channel>
</rss>

