<?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 Kinetis - Big endian in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252279#M7209</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I am using HCS12 controllers.&lt;/P&gt;&lt;P&gt;Now I am thinking of using Kinetis controllers but I have tons of code written for big endian controllers.&lt;/P&gt;&lt;P&gt;Does anyone know if Kinetis controllers &amp;amp; CW 10.2/10.3 are able to work with big endian?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nikos &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2013 08:34:22 GMT</pubDate>
    <dc:creator>Eric_t</dc:creator>
    <dc:date>2013-02-08T08:34:22Z</dc:date>
    <item>
      <title>Kinetis - Big endian</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252279#M7209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I am using HCS12 controllers.&lt;/P&gt;&lt;P&gt;Now I am thinking of using Kinetis controllers but I have tons of code written for big endian controllers.&lt;/P&gt;&lt;P&gt;Does anyone know if Kinetis controllers &amp;amp; CW 10.2/10.3 are able to work with big endian?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nikos &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 08:34:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252279#M7209</guid>
      <dc:creator>Eric_t</dc:creator>
      <dc:date>2013-02-08T08:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis - Big endian</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252280#M7210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please explain exactly how the endian-ness will affect your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 16:01:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252280#M7210</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2013-02-08T16:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis - Big endian</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252281#M7211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not going to ask why you need it - IMHO you don't need to justify your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search this forum for 'endian' and you'll find that it depends on which Kinetis.&amp;nbsp; Also check out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/02/19/a-little-or-big-indian-a-plea-for-peace/" style="font-size: 10pt; line-height: 1.5em;" title="http://mcuoneclipse.com/2012/02/19/a-little-or-big-indian-a-plea-for-peace/"&gt;http://mcuoneclipse.com/2012/02/19/a-little-or-big-indian-a-plea-for-peace/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 21:26:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252281#M7211</guid>
      <dc:creator>bowerymarc</dc:creator>
      <dc:date>2014-01-22T21:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis - Big endian</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252282#M7212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ARM cores have a bit that controls whether it operates in little or big endian mode. But this bit is often (or usually) fixed to little-endian in specific chips. The Kinetis sets to it little-endian, which is true for all Kinetis derivatives (&lt;EM&gt;as far as I know&lt;/EM&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some peripherals that can work with either little-endian or big-endian storage (eg. Ethernet and USB controllers: see &lt;STRONG&gt;ETHER_DBSWP&lt;/STRONG&gt; bit in &lt;STRONG&gt;ECR&lt;/STRONG&gt; in 'some' version of the EMAC).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since almost nothing from HCS12 peripheral driver code can be used on the Kinetis there shouldn't be any real issues. When writing protocol code (such as Ethernet/TCP/IP where all is in big-endian order) it is to be hoped that the code is written in a manner that is not endian-dependent since that would have been a "portability-mistake". If this is the case it will be necessary to convert all half- and long-words used each time they occur in the original code. Using a macro to do this is a common strategy - when the endianness doesn't require a conversion it can be a dummy macro that doesn't do anything and in the other case it swaps the byte content around. I think that there is an instruction in the Cortex that can do this very efficiently if the macro can be optimised to use the appropriate assembler command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 00:23:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252282#M7212</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-01-23T00:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis - Big endian</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252283#M7213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#include &amp;lt;types.h&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use macros in there such as &lt;STRONG&gt;ieee_htons&lt;/STRONG&gt;() which adjust depending on whether the processor is big or little, then your code will be portable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 18:15:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252283#M7213</guid>
      <dc:creator>bowerymarc</dc:creator>
      <dc:date>2014-01-29T18:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis - Big endian</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252284#M7214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not able to find this header file. I am using Kinetis k60 uc . I want to convert little endian float values to big endian float. Did you get some solution for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Amit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 10:58:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-Big-endian/m-p/252284#M7214</guid>
      <dc:creator>Amit_Kumar1</dc:creator>
      <dc:date>2014-09-17T10:58:58Z</dc:date>
    </item>
  </channel>
</rss>

