<?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: 16 and 32 bit comnination in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133693#M1945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 May 2007 22:10:05 GMT</pubDate>
    <dc:creator>ernestsnaith</dc:creator>
    <dc:date>2007-05-14T22:10:05Z</dc:date>
    <item>
      <title>16 and 32 bit comnination</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133688#M1940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have the timer running as well as secondary counter which increments on timer overflow. I am storing values of both at regualr intervals. Is there away of storing both 16 bit values as a long integer type to be used in expressions at a later time? Also is the reverse possible? accessing high and low parts of long int.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cheers&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 04:48:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133688#M1940</guid>
      <dc:creator>ernestsnaith</dc:creator>
      <dc:date>2007-05-14T04:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: 16 and 32 bit combination</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133689#M1941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;...using&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Codewarrior 4.5&lt;/DIV&gt;&lt;DIV&gt;MC9S12XDT512&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 06:00:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133689#M1941</guid>
      <dc:creator>ernestsnaith</dc:creator>
      <dc:date>2007-05-14T06:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: 16 and 32 bit comnination</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133690#M1942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&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;A possible method is to form a union between a long and an integer array.&amp;nbsp; You can then&amp;nbsp;manipulate the value of the individual words forming the long.&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;&lt;/FONT&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;#define dword unsigned long&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;typedef union {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;word wordval[2];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;dword val;&lt;BR /&gt;} long_val;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;long_val timer;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;dword temp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;timer.wordval[0] = highreg;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;timer.wordval[1] = lowreg;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;temp = timer.val;&amp;nbsp; // 32-bit value&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;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 13:04:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133690#M1942</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-05-14T13:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: 16 and 32 bit comnination</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133691#M1943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;bigmac wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;typedef union {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;word wordval[2];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;dword val;&lt;BR /&gt;} long_val;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;long_val timer;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;dword temp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;timer.wordval[0] = highreg;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;timer.wordval[1] = lowreg;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;I'm missing the big red warning in your suggestion. How can you be sure about the order of high and low word?&lt;BR /&gt;&lt;BR /&gt;Oliver&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 14:51:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133691#M1943</guid>
      <dc:creator>Obetz</dc:creator>
      <dc:date>2007-05-14T14:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: 16 and 32 bit comnination</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133692#M1944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Hello Oliver,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;It is my understanding that the &lt;FONT size="2"&gt;MC9S12XDT512 is big endian, and the code was presented with this in mind.&amp;nbsp; For a little endian case, the allocation of individual word values would obviously need to be reversed.&lt;/FONT&gt;&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;Since the problem presented was to specifically deal with hardware registers, "portability" does not seem to be an issue in this instance.&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;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 15:42:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133692#M1944</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-05-14T15:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: 16 and 32 bit comnination</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133693#M1945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 22:10:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/16-and-32-bit-comnination/m-p/133693#M1945</guid>
      <dc:creator>ernestsnaith</dc:creator>
      <dc:date>2007-05-14T22:10:05Z</dc:date>
    </item>
  </channel>
</rss>

