<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>The Embedded Beat: Freescale Blog Community - Software Meets Silicon</title>
    <link>https://community.freescale.com/community/the-embedded-beat</link>
    <description>Freescale employees blogging on trends, technologies, tools and techniques that are making the world a smarter place.</description>
    <language>en</language>
    <pubDate>Wed, 19 Jun 2013 04:00:03 GMT</pubDate>
    <generator>Jive SBS 5.0.3.0 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2013-06-19T04:00:03Z</dc:date>
    <dc:language>en</dc:language>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/freescale-software-meets-silicon" /><feedburner:info uri="freescale-software-meets-silicon" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>freescale-software-meets-silicon</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
      <title>Is Moore’s Law relevant when it comes to the edge nodes of IoT, or is it all about packaging now?</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/9EVOeuuY2Ek/is-moore-s-law-relevant-when-it-comes-to-the-edge-nodes-of-iot-or-is-all-about-packaging-now</link>
      <description>&lt;!-- [DocumentBodyStart:b610f38b-aaed-4f96-99c3-b30b350ff682] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;A couple of weeks ago I was a part of the panel at the &lt;a class="jive-link-external-small" href="http://www.gsaglobal.org/events/2013/0418/"&gt;GSA Silicon Summit&lt;/a&gt;. &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;The overview of the summit was described by the GSA team on their web-site as:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: black; font-family: 'Arial','sans-serif';"&gt;&lt;em&gt;&amp;#8220;Moore&amp;#8217;s Law has transcended computing expectations; however, its promise will eventually reach scalability limitations due to extraordinary consumer demands. Future technology encompasses breakthroughs capable of interaction with the outside world, which the More than Moore movement achieves. Through integrating functionalities that do not scale to deliver cost-optimized and value-added system solutions, this trend holds significant potential for the industry. This event will explore the business and technical factors defining the More than Moore movement, and address how it will yield revolutionary electronic devices.&amp;rdquo; &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;In a way (just my two cents here, and not a reflection of what GSA organizers told me), the organizers were politely questioning how relevant Moore&amp;#8217;s law will be in the future. I was part of the panel titled &amp;#8220;Disruptive Innovation &amp;#8211; Enabling Technology for the Connected World of Tomorrow,&amp;rdquo; which was moderated by my long time industry friend Dan Rabinovitsj, who is the SVP &amp;amp; GM of Wired &amp;amp; Wireless Infrastructure Networking BU at Qualcomm Atheros, and the discussions turned out to be great and at times controversial. No, not about Moore&amp;#8217;s Law, but ironically about the role of cellular operators in the IoT (refer to my recent blog about &lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1561" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2013/04/07/will-the-internet-of-things-iot-turn-your-smart-phone-into-the-center-of-the-universe"&gt;the role of Smart phones and IoT&lt;/a&gt;). &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;So back to the topic of Moore&amp;#8217;s Law, which was an observation that actually was made by Gordon Moore of Intel, in 1965. Back then he said that the number of transistors per square inch on integrated circuits had doubled every year since the integrated circuit was invented, and that the trend would continue for the (back then) foreseeable future. Later on that pace of doubling per year slowed down to around every 18 months, and hence the current definition of Moore's Law, uses the 18 months number. &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;In previous blogs we looked at the &amp;#8220;box level&amp;rdquo; building blocks of the IoT from the edge node all the way through the cloud. As outlined in my original white paper, embedded processing is present throughout the entire system, and one may say that indeed it is embedded processing that is the central point in making IoT happen. Depending on the application and what part of the system we are considering, embedded processing which acts as the &amp;#8220;brain&amp;rdquo; of the system, works hand in hand with a variety of other technologies to accomplish its objectives. &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1577-4311/Image+1+iot+box+product+level+view.JPG"&gt;&lt;img alt="Image 1 iot box product level view.JPG" class="jive-image jive-image-thumbnail" height="459" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1577-4311/620-459/Image+1+iot+box+product+level+view.JPG" width="620"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;In this blog, I want to focus on the edge products, which as can be seen, include the most amount of diversity of the &amp;#8220;box level&amp;rdquo; products. The types of edge/sensing nodes needed for the Internet of Things vary widely, depending on the applications involved. Edge nodes (sometimes also referred to as &amp;#8220;leaf nodes&amp;rdquo;) could include a camera system for image monitoring; water or gas flow meters for smart energy; radar vision when active safety is needed; RFID readers sensing the presence of an object or person; doors and locks with open/close circuits that indicate a building intrusion; or a simple thermometer measuring temperature. The bottom line is that there could be many different types of edge nodes, depending on the applications. Who could forget the heat-seeking mechanical bugs that kept track of the population of a building in the movie Minority Report? Those mechanical bugs represent potential edge nodes of the future. These nodes all will carry a unique ID and can be controlled separately via a remote command and control topology, and all could/would include:&lt;/span&gt;&lt;/p&gt;&lt;ul style="list-style-type: disc;"&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;An MCU&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;Sensors and actuators&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;Integrated modem chip (connectivity)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;Energy source&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1577-4312/image+2+edge+node+products.JPG"&gt;&lt;img alt="image 2 edge node products.JPG" class="jive-image jive-image-thumbnail" height="463" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1577-4312/620-463/image+2+edge+node+products.JPG" width="620"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;As mentioned in previous blogs, these nodes need to be very small, low cost, low power, low complexity, and robust. Here are a couple of examples, with one being an event monitoring module, and the other Medtronics&amp;#8217; glucose monitoring device that uses Bluetooth to communicate with various gateways. The edge node will always be communicating with a gateway/hub, which in turn will communicate with the core network and cloud based processing. &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black;"&gt;From a pure volume perspective, the number of edge nodes will dwarf all other markets in the world. Allow me to explain. Today the ultimate consumer devices with very high volume is the cell phone market. In my household, my wife and I each have a smart phone. We have two daughters, and in 5-7 years each will have their own smart phones, so my household will have four smart phones in five to seven years. If I count every door that opens up, every window that opens up, every appliance, and every electrical wall outlet, every smoke detector, thermostats, light switch, sprinkler zone controller, etc., my house has between 68 to 100 IoT edge node potentials that could be connected to the one gateway box inside of our house. So in five to seven years we would be comparing four smart phones to minimum 68 edge node boxes. This was a household example where there are smart phones present there. In most other IoT applications (think factory process automations, road infrastructure IoT, logistics, environment, etc.) there are no cellular phones involved. Hence the volume of IoT edge nodes will dwarf our existing consumer volume devices volumes by orders of magnitude.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1577-4313/image+3+example+connected+home+Iot.JPG"&gt;&lt;img alt="image 3 example connected home Iot.JPG" class="jive-image jive-image-thumbnail" height="468" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1577-4313/620-468/image+3+example+connected+home+Iot.JPG" width="620"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000;"&gt;The pictorial above can show the diversity of the types of sensing nodes inside a connected home. From an underlying silicon and packaging technology perspective, edge nodes have very little digital CMOS silicon in them, to be subject to Moore&amp;#8217;s law. The types of connectivity we are talking about here all have very small basebands, and bigger RF and analog circuitries. The power source (whether battery or an energy harvester) will have very little to do with Moore&amp;#8217;s law, and the sensors are mostly about MEMS, electromechanical circuits and analog, than any Moore&amp;#8217;s law related CMOS. The MCU will have the most to do with Moore&amp;#8217;s law, but even there, this class of MCUs, will be dominated by the precision analog circuitry and non-volatile memory (NVM), and the core and sea of gates will be the smaller part of the die. So from a system level perspective, the product volume runner of IoT, will have very little to do with Moore&amp;#8217;s law.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000;"&gt;When you look at the diversity of technologies in the edge nodes, such as precision analog, MEMS, RF, Flash, battery and or rechargeable coils (wireless charging) or energy harvesters, antennas of different shape, etc., you realize that bringing all of these technologies together cost effectively, operating under industrial or auto specifications, and shrinking them while optimizing the system performance, is really a herculean packaging challenge, and not a silicon integration exercise. &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000;"&gt;This is the part of the industry that has relatively been neglected and not a lot of innovations have been happening, however there is a type of packaging technology that can address the integration challenges of the edge nodes of IoT, and while I normally stay away from &amp;#8220;pitching/pushing&amp;rdquo; products, in this case I will be making an exception, and in my next blog I will introduce you to Freescale Redistributed Packaging technology (RCP). &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif';"&gt;&lt;em&gt;&lt;span style="color: #000000;"&gt;Kaivan Karimi &lt;/span&gt;is &lt;span style="color: black;"&gt;Director of Global Strategy and Business Development, MCUs&lt;/span&gt; at Freescale and can be reached at &lt;a class="jive-link-email-small" href="mailto:kaivan.karimi@freescale.com"&gt;kaivan.karimi@freescale.com&lt;/a&gt;.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:b610f38b-aaed-4f96-99c3-b30b350ff682] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/9EVOeuuY2Ek" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">arm</category>
      <category domain="/community/the-embedded-beat/tags">mcu</category>
      <category domain="/community/the-embedded-beat/tags">sensor</category>
      <category domain="/community/the-embedded-beat/tags">xtrinsic</category>
      <category domain="/community/the-embedded-beat/tags">sensors</category>
      <category domain="/community/the-embedded-beat/tags">everything-wireless</category>
      <category domain="/community/the-embedded-beat/tags">every-connection-matters</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">smart-energy</category>
      <category domain="/community/the-embedded-beat/tags">802.15.4</category>
      <category domain="/community/the-embedded-beat/tags">green-technology</category>
      <category domain="/community/the-embedded-beat/tags">healthcare</category>
      <category domain="/community/the-embedded-beat/tags">zigbee</category>
      <category domain="/community/the-embedded-beat/tags">smart-grid</category>
      <category domain="/community/the-embedded-beat/tags">mems</category>
      <pubDate>Sat, 11 May 2013 02:01:39 GMT</pubDate>
      <author>r62516@freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2013/05/20/is-moore-s-law-relevant-when-it-comes-to-the-edge-nodes-of-iot-or-is-all-about-packaging-now</guid>
      <dc:date>2013-05-11T02:01:39Z</dc:date>
      <clearspace:dateToText>4 weeks, 7 hours ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2013/05/20/is-moore-s-law-relevant-when-it-comes-to-the-edge-nodes-of-iot-or-is-all-about-packaging-now</feedburner:origLink></item>
    <item>
      <title>Sensor fusion and the Internet of Things (IoT)</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/HKHac67h3-c/sensor-fusion-and-the-internet-of-things-iot</link>
      <description>&lt;!-- [DocumentBodyStart:3c48df8b-da25-4f00-8901-355ef14c6628] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;a href="http://cache.freescale.com/files/32bit/doc/white_paper/SENFEIOTLFWP.pdf"&gt;&lt;img alt="KaivanKarimiSensorWhitePaper.JPG" class="jive-image" height="347" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1578-4296/300-347/KaivanKarimiSensorWhitePaper.JPG" style="float: right;" width="300"/&gt;&lt;/a&gt;Last month I had a paradigm shifting experience in Europe, when I presented a paper about &lt;span style="font-family: 'Arial','sans-serif'; color: #3366ff; font-size: 10pt;"&gt;&lt;em&gt;&lt;a class="jive-link-external-small" href="http://cache.freescale.com/files/32bit/doc/white_paper/SENFEIOTLFWP.pdf"&gt;&lt;span style="color: #3366ff;"&gt;The Role of Sensor Fusion and Remote Emotive Computing (REC) in the Internet of Things (IoT).&lt;/span&gt;&lt;/a&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; I had presented this paper in the U.S. multiple times to a few analysts and reporters, as well as at a couple of different forums and shows. The reaction that I got from the European audience was completely different than what I had experienced in the US, and made me realize how different the experience of IoT could be in Europe versus the U.S.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Now about the topic and setting up the context to the reaction I received from that audience. The paper was about the pervasiveness of sensor technology and how the sensors are experiencing a renaissance of sorts as micro-electromechanical systems (MEMS) technology is becoming less expensive and further miniaturized, in turn fueling penetration of sensors into new applications and creating new potential for the sensor market. Sensors are now found in a wide variety of applications, such as smart mobile devices, automotive systems, industrial control, healthcare, oil exploration and climate monitoring. Sensors are used almost everywhere, and now sensor technology is beginning to closely mimic the ultimate sensing machine &amp;hellip; the human being. The technology that allows this to happen is &lt;em&gt;sensor fusion&lt;/em&gt;, which leverages a microcontroller (a &amp;#8220;brain&amp;rdquo;) to fuse the individual data collected from &lt;/span&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;multiple sensors to get a more accurate and reliable view of the data than one would get by using the data from each discrete sensor on its own. Sensor fusion creates a situation in which &lt;em&gt;the whole is much greater than the sum of its parts&lt;/em&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Sensor fusion enables &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Context_awareness"&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;&lt;em&gt;context-awareness&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;, which has huge potential for the Internet of Things (IoT). Advances in sensor fusion for &lt;em&gt;remote emotive computing&lt;/em&gt; (emotion sensing and processing) could also lead to exciting new applications in the future including smart healthcare. However, these capabilities spark significant privacy concerns that IoT governance will need to address. Massive amounts of context-aware data will become available as use of sensor fusion and REC technologies increases. This data, along with the IoT&amp;#8217;s access to the &amp;#8220;global neural network in the sky&amp;rdquo; and cloud-based processing resources, will lead to a tremendous expansion in the delivery of context-aware services, customized for any given situation.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1578-4252/Fusion.JPG"&gt;&lt;img alt="Fusion.JPG" class="jive-image jive-image-thumbnail" height="425" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1578-4252/620-425/Fusion.JPG" width="620"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;When combining all of these technologies, sensor fusion takes the simultaneous input from the multiple sensors, processes the input and creates an output that is greater than the sum of its parts. Sensor fusion provides a whole host of capabilities that can make our lives easier and enables a variety of services that can leverage these capabilities.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Research shows that heart rate increases due to physical activities have a different pattern and slope than increases due to adrenalin from excitation. Hence, one can use algorithms and analyze sensor data to electronically detect the types of emotion a person is displaying.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1578-4251/Context.JPG"&gt;&lt;img alt="Context.JPG" class="jive-image jive-image-thumbnail jiveImage" height="419" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1578-4251/620-419/Context.JPG" width="620"/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Here&amp;#8217;s an example of a gaming platform that can detect emotions electronically by monitoring and data acquisition from physiological variables and states, such as: &lt;/span&gt;&lt;/p&gt;&lt;ul style="list-style-type: disc;"&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Muscle relaxation (MR) &amp;#8211; via a pressure sensor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Heart rate variability (HRV) &amp;#8211; via a two-electrode ECG on a chip&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Sweat (S) &amp;#8211; via a capacitive sensor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Attitude (A) &amp;#8211; via an accelerometer monitoring a person&amp;#8217;s state of relaxation (jerky movements vs. steady hands)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Muscle contraction (MC) &amp;#8211; via a pressure sensor&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;Using the sensor data collected, an MCU in the game platform could, for example, detect emotions and give the gamer feedback during game situations to make the game more exciting. How about making turns faster and more difficult to maneuver in a driving game until the gamer shows a more relaxed state (a less jerky reading from the accelerometer)? Hence, the calm driver with better command over his/her emotions will have a better score (similar to real life). This would be considered &lt;em&gt;local emotive computing&lt;/em&gt; if the local console&amp;#8217;s MCU provided the processing function or &lt;em&gt;remote emotive computing&lt;/em&gt; if a cloud-based system provided the processing function. In a cloud-based system, sophisticated &amp;#8220;big data&amp;rdquo; algorithms can be leveraged to provide a more elaborate response to the gaming scenario.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #000000; font-size: 10pt;"&gt;In another example, sensors could be used to detect emotion by measuring the way a user holds a cell phone to type or make a call. Furthermore, software algorithms could be used to provide additional context as to the state of mind of the individual by analyzing the way the person texts, how jerky the phone movement is or how many mistakes are made while typing (use of &lt;em&gt;backspace&lt;/em&gt; key).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000;"&gt;The addition of sensor fusion platforms and remote emotive computing dramatically increases the capability of the sensing nodes in the IoT. In using contextual information to formulate a deterministic action, context interfaces occur within (and in between) first a human being, then the environment and, lastly, machine and infrastructure elements. Nothing detects and provides the readout of human beings&amp;#8217; emotions the way sensors do. Sensors provide access to the human mindset, making an experience more &amp;#8220;personal.&amp;rdquo; Now what&amp;#8217;s the most secret and precious thing that a person holds and usually is difficult to obtain, unless the person volunteers it? It is the person&amp;#8217;s emotions and their reaction to their various stimuli? What if sensor fusion would allow a service provider know exactly how you feel when you are exposed to a certain product, location, environment, etc? What is the value of that information to the people who are the providers of those goods and services? Do you really want the world to have access to your most inner feelings, and what your wife or significant other may not know, the local service provider to know?&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000;"&gt;In previous blogs we had already talked about the privacy issues on the existing internet of people, without any notion of sensor fusion. This was the exact concern the Europeans had, the sense of loss of their privacy. During my talk, you could hear a pin drop in the auditorium of close to 500 people, and after the talk there was more time spent by the audience explaining to me the privacy laws in Sweden and Germany, than any of the technical discussions I was used to from my US presentations. The best way of describing the situation was that the audience was completely freaked out of the notion of a big brother reading their emotions &amp;hellip; what a difference compared to the US where we the people have clicked away a lot of our privacy rights via &amp;#8220;click-through&amp;rdquo; terms and conditions in an excitement to use the latest apps on our smart phone. In the US, it&amp;#8217;s all about the technical discussions and the price points, and somehow we have all accepted the fact that &amp;#8220;commerce&amp;rdquo; is the big brother we have created for ourselves, so cheap access to the latest and greatest apps. I have now come to understand that security and privacy of IoT will follow different paths in the US vs. Europe. Which model do you prefer?&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;span lang="EN-GB" style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Kaivan can be reached at&amp;nbsp; &lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&lt;a class="jive-link-email-small" href="mailto:kaivan.karimi@freescale.com"&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: #0000ff; font-size: 10pt;"&gt;kaivan.karimi@freescale.com&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:3c48df8b-da25-4f00-8901-355ef14c6628] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/HKHac67h3-c" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">accelerometer</category>
      <category domain="/community/the-embedded-beat/tags">sensor</category>
      <category domain="/community/the-embedded-beat/tags">xtrinsic</category>
      <category domain="/community/the-embedded-beat/tags">sensors</category>
      <category domain="/community/the-embedded-beat/tags">everything-wireless</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">medical-by-design</category>
      <category domain="/community/the-embedded-beat/tags">healthcare</category>
      <category domain="/community/the-embedded-beat/tags">mems</category>
      <pubDate>Sat, 11 May 2013 02:04:13 GMT</pubDate>
      <author>r62516@freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2013/05/14/sensor-fusion-and-the-internet-of-things-iot</guid>
      <dc:date>2013-05-11T02:04:13Z</dc:date>
      <clearspace:dateToText>1 month, 3 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2013/05/14/sensor-fusion-and-the-internet-of-things-iot</feedburner:origLink></item>
    <item>
      <title>The i.MX 6 series: Getting it done (Part 3 of capabilities convergence, device divergence)</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/jVoMtlXJ5gk/the-imx-6-series-getting-it-done-part-3-of-capabilities-convergence-device-divergence</link>
      <description>&lt;!-- [DocumentBodyStart:03b78579-ef11-40fd-895c-66b978c5ce9f] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;The i.MX 6 Series Ecosystem&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;As part of Freescale&amp;#8217;s premiere series of Smart Application Blueprint for Rapid Engineering (SABRE) market-focused development systems, Freescale has deployed &lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/overview.jsp?code=SABRE_HOME"&gt;three SABRE designs &lt;/a&gt;focused on automotive infotainment, smart devices, and the general embedded market, as well an evaluation kit (EVK) based on the i.MX 6SoloLite, which drives current and next-generation electronic paper display (EPD) panels. The SABRE board for smart devices, SABRE platform for smart devices, SABRE for automotive infotainment and the i.MX 6SoloLite EVK provide customers with the board layout, circuit design, software and other documentation necessary to quickly produce their own i.MX 6 series-based platforms.&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1537-3093/Kylei.MX6BlogGraphic.JPG"&gt;&lt;img alt="Kylei.MX6BlogGraphic.JPG" class="jive-image jive-image-thumbnail" height="403" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1537-3093/620-403/Kylei.MX6BlogGraphic.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="620"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Freescale has been working with the leading embedded system design companies, OS vendors, tools vendors, and application developers to create one of the broadest ecosystems in the industry supporting the i.MX 6 series. This is a critical aspect to the i.MX 6 series as it enables broad choices and options in designing products for the processor family. And with the recently improved online &lt;a class="jive-link-community-small" data-containerId="1" data-containerType="14" data-objectId="2004" data-objectType="14" href="https://community.freescale.com/community/imx"&gt;i.MX Community&lt;/a&gt; within the &lt;em&gt;Freescale Community&lt;/em&gt;, the ability to find answers to your design and development questions has never been easier.&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1537-3040/ecomaps.jpg"&gt;&lt;img alt="ecomaps.jpg" class="jive-image jive-image-thumbnail" height="464" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1537-3040/620-464/ecomaps.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="620"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;In Summary&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The market for intelligent devices is increasing exponentially. Tomorrow&amp;#8217;s smart devices, auto infotainment and in-flight entertainment systems, medical systems, personal and enterprise-class intelligent control and data systems, and new classes of devices never before seen need to present data and user interface choices to the end user primarily through rich sound, video, voice, pictures and touch, rather than keyboards and mice.&lt;/p&gt;&lt;p&gt;The need for manufacturers to quickly provide multiple devices to fit specific market segments or niches and provide their customers with a broader range of choices is increasing just as quickly. The i.MX 6 series was designed specifically to enable this new market by bringing together high-performance scalable multimedia processing, a software-compatible family of five processors and pin*-compatible processor solutions with integrated power management so that a manufacturer can deploy a full portfolio of products with a single hardware design.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:03b78579-ef11-40fd-895c-66b978c5ce9f] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/jVoMtlXJ5gk" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">arm</category>
      <category domain="/community/the-embedded-beat/tags">i.mx</category>
      <category domain="/community/the-embedded-beat/tags">everything-wireless</category>
      <category domain="/community/the-embedded-beat/tags">every-connection-matters</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">smart-mobile-devices</category>
      <category domain="/community/the-embedded-beat/tags">medical-by-design</category>
      <category domain="/community/the-embedded-beat/tags">automobility</category>
      <category domain="/community/the-embedded-beat/tags">green-technology</category>
      <category domain="/community/the-embedded-beat/tags">healthcare</category>
      <category domain="/community/the-embedded-beat/tags">tablet</category>
      <category domain="/community/the-embedded-beat/tags">i.mx6-series</category>
      <category domain="/community/the-embedded-beat/tags">i.mx6_series</category>
      <category domain="/community/the-embedded-beat/tags">i.mx6_solo</category>
      <category domain="/community/the-embedded-beat/tags">i.mx6_dual</category>
      <category domain="/community/the-embedded-beat/tags">i.mx6_duallite</category>
      <category domain="/community/the-embedded-beat/tags">i.mx6_sololite</category>
      <category domain="/community/the-embedded-beat/tags">i.mx_quad</category>
      <pubDate>Thu, 03 Jan 2013 15:08:48 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2013/01/15/the-imx-6-series-getting-it-done-part-3-of-capabilities-convergence-device-divergence</guid>
      <dc:date>2013-01-03T15:08:48Z</dc:date>
      <clearspace:dateToText>5 months, 4 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2013/01/15/the-imx-6-series-getting-it-done-part-3-of-capabilities-convergence-device-divergence</feedburner:origLink></item>
    <item>
      <title>Let's make it real - Internet of Things</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/Nq46ee7xbJ0/lets-make-it-real--internet-of-things</link>
      <description>&lt;!-- [DocumentBodyStart:f9307eff-69c1-44f0-8aa5-b9acbc72afb8] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;People have been talking about the &amp;#8220;Internet of Things&amp;rdquo; for years with the promise of creating a connected world. I was fascinated by &amp;#8220;The Jetsons&amp;rdquo; as a kid and I realize now that it was an early look at the &amp;#8220;IoT&amp;rdquo; world. Ok, yes, &amp;#8220;The Jetsons&amp;rdquo; is a bit of a stretch of the imagination, even today. But, in reality the transition to &amp;#8220;IoT&amp;rdquo; is happening and is being accelerated by technologies that transform devices from being information gatherers, to being part of a smart system where the data collected provides consumers with real improvements to their lives.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What I've found from my experience at Freescale is that creating and implementing these smart systems takes an ecosystem &amp;#8211; no one company can cover the gamut of needs. Not only are ecosystems valued now, they are important and necessary to provide complete solutions. More importantly, it&amp;#8217;s not about how many partners are in your specific ecosystem &amp;#8211; it&amp;#8217;s about having the RIGHT partners. &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As I stated, the &amp;#8220;IoT&amp;rdquo; is everywhere, some people even use the term &amp;#8220;Internet of everything.&amp;rdquo; At ARM TechCon which was held in Santa Clara a couple of weeks ago with &amp;gt;90 exhibitors and 5,000 attendees, the &amp;#8220;IoT&amp;rdquo; as a reality was certainly obvious as I walked through the show floor. The picture below highlights an example of a RIGHT ecosystem with Freescale and Oracle. Our company booths were back-to-back and Oracle showcased demos based on i.MX processors running &lt;a class="jive-link-external-small" href="http://www.oracle.com/us/technologies/java/embedded/standard-edition/overview/index.html"&gt;Java SE Embedded&lt;/a&gt;.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1526-2818/photo2.JPG"&gt;&lt;img alt="photo2.JPG" class="jive-image jive-image-thumbnail" height="465" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1526-2818/620-465/photo2.JPG" width="620"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The shot shown above uses Freescale and Oracle technologies. The SABRE Lite board, based on the &lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&amp;amp;nodeId=018rH3ZrDRB24A"&gt;i.MX 6Quad processor&lt;/a&gt;, is used as the aggregator for the smart grid &amp;#8211; it receives data from a power meter and then sends it to the utility company for analysis and action. The i.MX 6Quad processor that&amp;#8217;s acting as the aggregator is part of Freescale&amp;#8217;s newest ARM applications processor family, the &lt;a class="jive-link-external-small" href="http://www.freescale.com/imx6series"&gt;i.MX 6 series&lt;/a&gt;, which was &lt;a class="jive-link-external-small" href="http://media.freescale.com/phoenix.zhtml?c=196520&amp;amp;p=irol-newsArticle&amp;amp;ID=1757923&amp;amp;highlight="&gt;launched this week&lt;/a&gt;. This platform addresses the needs of the &amp;#8220;IoT&amp;rdquo; &amp;#8211; scalability, flexibility, performance and low power. The aggregator also communicates to an i.MX based tablet with a user interface (built using Java FX) to view the data. As the saying goes, with knowledge comes power. Consumers can manage their own energy usage to improve their lives if they have the right data and tools to do so. &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;A partnership between Freescale (makers of applications &lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;processors based on ARM technology&lt;/span&gt;) and Oracle (makers of Enterprise software) may not seem like a customer-centric partnership at first. However for the &amp;#8220;IoT&amp;rdquo; to become a reality all devices from the enterprise to the edge must be connected and secure.&amp;nbsp; Oracle&amp;#8217;s vision is that Java is not only the platform running in the enterprise but also on edge embedded devices based on ARM processors such as &lt;a class="jive-link-external-small" href="http://www.freescale.com/imx"&gt;Freescale&amp;#8217;s i.MX processors&lt;/a&gt;. Couple the power and performance of the i.MX portfolio on the embedded side, with the dynamic and growing Java developer community &amp;#8211; and the devices that we can see in the future are limited only by the imagination. Heck, who would have thought about a &amp;lsquo;connected&amp;#8217; thermostat five years ago?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:f9307eff-69c1-44f0-8aa5-b9acbc72afb8] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/Nq46ee7xbJ0" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">arm</category>
      <category domain="/community/the-embedded-beat/tags">i.mx</category>
      <category domain="/community/the-embedded-beat/tags">mcu</category>
      <category domain="/community/the-embedded-beat/tags">everything-wireless</category>
      <category domain="/community/the-embedded-beat/tags">every-connection-matters</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">smart-mobile-devices</category>
      <category domain="/community/the-embedded-beat/tags">medical-by-design</category>
      <category domain="/community/the-embedded-beat/tags">smart-energy</category>
      <category domain="/community/the-embedded-beat/tags">healthcare</category>
      <pubDate>Tue, 13 Nov 2012 18:36:09 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/11/15/lets-make-it-real--internet-of-things</guid>
      <dc:date>2012-11-13T18:36:09Z</dc:date>
      <clearspace:dateToText>7 months, 5 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/11/15/lets-make-it-real--internet-of-things</feedburner:origLink></item>
    <item>
      <title>Processor Expert Component Adds Touch to the Freescale Freedom Development Platform</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/p5O39C8WMSQ/processor-expert-component-adds-touch-to-the-freescale-freedom-board</link>
      <description>&lt;!-- [DocumentBodyStart:ba9cbe41-37a0-4a20-ad5d-b0df7041440a] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Through the use of tutorials, I have covered several features of the Freescale &lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1485" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2012/07/27/the-freedom-board"&gt;KL25Z Freedom development platform&lt;/a&gt;: its &lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/09/07/tutorial-enlighting-the-freedom-kl25z-board/"&gt;RGB LED&lt;/a&gt;, its &lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/09/21/tutorial-accelerating-the-kl25z-freedom-board/"&gt;accelerometer&lt;/a&gt; and the &lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/09/29/tutorial-freedom-with-freertos-and-kinetis-l/"&gt;RTOS&lt;/a&gt;. My coverage has missed one useful peripheral thus far that is in plain view&amp;#8212;the touchpad slider area (Figure 1). It is time I set matters right with this blog article.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2696/pastedImage_6.png"&gt;&lt;img alt="" class="jiveImage" height="482" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2696/375-482/pastedImage_6.png" style="width: 375px; height: 482px; display: block; margin-left: auto; margin-right: auto;" width="375"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 1. Touchpad slider area (outlined in red) on the Freescale Development Platform.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;The Kinetis L Series MCU has implemented a Touch Sensing Interface (TSI) module in the silicon. It helps a lot when implementing a capacitance touch sensing application, but requires a lot of reference manual reading. See Tom Thompson&amp;#8217;s recent &lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif';"&gt;blog article&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; for a &lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1508" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2012/10/15/using-the-touch-interface-on-the-freescale-freedom-development-platform"&gt;bare-metal implementation of a touch-sensing application using the TSI module&lt;/a&gt; on this board. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;However, the article covers only a few of the many features the TSI has to offer. Features left unexplored are hardware-triggered scans and low-power mode operation, for example. Accessing more of the features at this level requires further heavy-duty reading. Banging on the bits can be a lot of fun, but it is also really hard and time consuming. Learning the deep intricacies of any silicon system and training it to jump through hoops is not necessarily the best use of your time. Software development cycles are fleeting and we know you often want ready-made embedded software solutions rather than having to reinvent the wheel. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Fortunately, there is a Processor Expert component that both simplifies this task for you and provides access to all of those nifty features. So in this tutorial I shall present Processor Expert&amp;#8217;s Touch Sensing Software (TSS) Library component. Combine this with Tom&amp;#8217;s article, and you can see both the power of bit banging, and the ease of the Processor Expert Software solution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;I shall not repeat the details in creating a Processor Expert project with CodeWarrior for MCUs v10.3 here. You should be able to find all the needed information in the &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/09/07/tutorial-enlighting-the-freedom-kl25z-board/"&gt;&lt;span style="font-family: 'Calibri','sans-serif';"&gt;LED&lt;/span&gt;&lt;/a&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;, &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/09/21/tutorial-accelerating-the-kl25z-freedom-board/"&gt;&lt;span style="font-family: 'Calibri','sans-serif';"&gt;Accelerometer&lt;/span&gt;&lt;/a&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; and &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/09/29/tutorial-freedom-with-freertos-and-kinetis-l/"&gt;&lt;span style="font-family: 'Calibri','sans-serif';"&gt;RTOS &lt;/span&gt;&lt;/a&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;tutorials.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Alternatively, if you do not want to start from scratch, you can add the touch support to any of the above tutorial projects.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Cambria','serif';"&gt;Adding the TSS_Library Processor Expert component&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Start by creating a CodeWarrior project based on the KL25Z MCU, and activate the Processor Expert tool. From the &lt;strong&gt;Components Library&lt;/strong&gt; view, I add the &lt;/span&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS_Library&lt;/span&gt;&lt;/strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; component to my project. This is done by right-clicking on the component and selecting &lt;span style="font-family: 'Calibri','sans-serif';"&gt;&lt;em&gt;&lt;strong&gt;Add to project&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; from the context menu (Figure 2), or with the &lt;strong&gt;+&lt;/strong&gt; icon in that view, or by double-clicking the &lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS_Library&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; component.&lt;/span&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2697/pastedImage_17.png"&gt;&lt;img alt="" class="jiveImage" height="368" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2697/345-368/pastedImage_17.png" style="width: 345px; height: 368px;" width="345"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Figure 2. Adding the TSS_Library component.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Now that we have added the software, it is time to start configuring the interface. This means we need to know what port and its pins connect to the electrodes that implement the touchpad. A glimpse of the board schematic reveals that the two electrodes are connected to &lt;span style="font-family: 'Calibri','sans-serif';"&gt;&lt;strong&gt;PTB16/Channel9&lt;/strong&gt;&lt;/span&gt; and &lt;span style="font-family: 'Calibri','sans-serif';"&gt;&lt;strong&gt;PTB17/Channel10&lt;/strong&gt;&lt;/span&gt; (Figure 3).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2698/pastedImage_20.png"&gt;&lt;img alt="" class="jiveImage" height="184" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2698/628-184/pastedImage_20.png" style="width: 628px; height: 184px; display: block; margin-left: auto; margin-right: auto;" width="628"/&gt;&lt;/a&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Figure 3. The electrode lines (TSI_CH09 and TSI_CH10) connect to Port B, pins PTB16 and PTB17.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;First, this component needs to support two electrodes. To do this, I select the &lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS_Library_Component&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; in my project. In the &lt;strong&gt;Component Inspector&lt;/strong&gt; view, I click on the &lt;strong&gt;+&lt;/strong&gt; sign in the &lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;Number of Electrodes&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; properties item to increase the electrode count to two (Figure 4).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Hint 1: If the &lt;strong&gt;Component Inspector&lt;/strong&gt; view is not visible: select &lt;strong&gt;Inspector&lt;/strong&gt; when right-clicking the &lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS_Library&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; icon.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Hint 2: In order to display the &lt;strong&gt;+&lt;/strong&gt; and &lt;strong&gt;-&lt;/strong&gt; buttons to change the electrode count as shown in the screenshot, I need to click in the field to select it.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&amp;nbsp; &lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2699/pastedImage_34.png"&gt;&lt;img alt="" class="jiveImage" height="421" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2699/628-421/pastedImage_34.png" style="display: block; margin-left: auto; margin-right: auto; width: 628px; height: 421px;" width="628"/&gt;&lt;/a&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Figure 4. Adding an electrode using the Number of Electrodes property.&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Having configured the component to support two electrodes, I continue merrily along in the &lt;strong&gt;Properties&lt;/strong&gt; view to couple the channel connections (Figure 5) to the appropriate port. These elements are marked in yellow in the figure.&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2700/pastedImage_54.png"&gt;&lt;img alt="" class="jiveImage" height="533" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2700/552-533/pastedImage_54.png" style="width: 552px; height: 533px; display: block; margin-left: auto; margin-right: auto;" width="552"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Figure 5. Specifying the electrode/channel connections.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Configuring the Controls&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;The elegant feature of this Processor Expert component is that it provides point-and-click support for all kind of human interface controls, and specifies how they generate values and responses to user events. So I add a slider control, and for now I go with its default settings (Figure 6):&lt;/span&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2701/pastedImage_1.png"&gt;&lt;img alt="" class="jiveImage" height="613" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2701/410-613/pastedImage_1.png" style="width: 410px; height: 613px;" width="410"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Figure 6. Configuring the human interface control for type and output range.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;As the screenshot shows, the control has been configured as an &lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;ASLIDER&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt; (Analog Slider) control. I have it configured so that it has a range of 0 through 64, and that the range values are stored in a structure named &lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS1_cKey0&lt;/span&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;. This structure name and value range is what we will use later when the TSS library detects a touch.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Adding LEDs&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;In my code I want to show the status of the slider (that is, that the slider was touched and where) using the RGB LED on the board. I will not explain how to add the add LED components to my project, as this is explained in detail in the LED tutorial.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Hint: I can copy-paste the LED component from my other tutorial projects. That way it only takes seconds to have it in my new project.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;When done, the &lt;strong&gt;Components&lt;/strong&gt; view should resemble Figure 7.&lt;/span&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2702/pastedImage_8.png"&gt;&lt;img alt="" class="jiveImage" height="312" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2702/302-312/pastedImage_8.png" style="width: 302px; height: 312px;" width="302"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;Figure 7. Project with LED components added.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;span lang="EN-US" style="font-family: 'Calibri','sans-serif';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Generating Processor Expert driver code&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Now I can generate the driver code based on my settings. The simplest way is to select the project and click &lt;strong&gt;Generate Processor Expert Code&lt;/strong&gt; (Figure 8):&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2703/pastedImage_15.png"&gt;&lt;img alt="" class="jiveImage" height="235" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2703/503-235/pastedImage_15.png" style="width: 503px; height: 235px;" width="503"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 8. Generating Processor Expert code.&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Processor Expert tool places the code it produces into the files &lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS1.c&lt;/span&gt; and &lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS1.h&lt;/span&gt;, which are located in the &lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;Generated_Code&lt;/span&gt; project folder (Figure 9).&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2704/pastedImage_22.png"&gt;&lt;img alt="" class="jiveImage" height="402" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2704/302-402/pastedImage_22.png" style="width: 302px; height: 402px;" width="302"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;strong&gt;Figure 9. Generated TSS Driver Code with TSS Files.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Initializing the TSS library&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Now that I have the code in the project, it is time to make use of it. For the TSS library APIs to function properly, I have to initialize it. For this I need to call &lt;code&gt;&lt;span lang="EN-US" style="font-size: 10.0pt;"&gt;Configure()&lt;/span&gt;&lt;/code&gt;. An easy way to provide that function is to &lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/03/08/dragdrop-in-processor-expert/"&gt;drag and drop&lt;/a&gt; that method into my source code (Figure 10):&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2705/pastedImage_26.png"&gt;&lt;img alt="" class="jiveImage" height="497" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2705/616-497/pastedImage_26.png" style="display: block; margin-left: auto; margin-right: auto; width: 616px; height: 497px;" width="616"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 10. Configuring the TSS Library via drag and drop.&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;With the library initialized, to capture user events I need to call the TSS library periodically using &lt;code&gt;&lt;span lang="EN-US" style="font-size: 10.0pt;"&gt;TSS_Task().&lt;/span&gt;&lt;/code&gt; So in &lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;main()&lt;/span&gt;I need&amp;nbsp; to add this function call to the event&amp;nbsp; loop, like so:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;int main(void)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /* Write your local variable definition here */&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /*** PE internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PE_low_level_init();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /*** End of PE internal initialization.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Configure(); /* initialize TSS library */&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;;) {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TSS_Task(); /* call TSS library to process touches */&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /*** Don't write any code pass this line ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /*** RTOS startup code. ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #ifdef PEX_RTOS_START&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PEX_RTOS_START();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Startup of the selected RTOS. */&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /*** End of RTOS startup code.&amp;nbsp; ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /*** PE end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;;){}&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp; /*** PE end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The function &lt;code&gt;&lt;span lang="EN-US" style="font-size: 10.0pt;"&gt;TSS_Task()&lt;/span&gt;&lt;/code&gt;detects if the slider has been touched, and invokes a callback function to handle the event. This callback is named &lt;code&gt;&lt;span lang="EN-US" style="font-size: 10.0pt;"&gt;fcallBack()&lt;/span&gt;&lt;/code&gt;. For my first (and only) control in the system this callback function&amp;nbsp; is &lt;code&gt;&lt;span lang="EN-US" style="font-size: 10.0pt;"&gt;TSS1_fCallback0()&lt;/span&gt;&lt;/code&gt;, as shown in Figure 11.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2706/pastedImage_5.png"&gt;&lt;img alt="" class="jiveImage" height="265" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2706/628-265/pastedImage_5.png" style="width: 628px; height: 265px;" width="628"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 11. The callback function that is invoked when the slider is touched.&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Double-clicking on that callback event opens the editor view to the user callback function code. This code is in the source file &lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;Events.c &lt;/span&gt;(Figure 12).&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2707/pastedImage_18.png"&gt;&lt;img alt="" class="jiveImage" height="456" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2707/611-456/pastedImage_18.png" style="width: 611px; height: 456px;" width="611"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 12. The placeholder stub for the slider callback function.&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Remember the &lt;em&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;Range&lt;/span&gt;&lt;/em&gt; and &lt;em&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;Structure Name&lt;/span&gt;&lt;/em&gt; we defined when configuring the control? Now it is time to use those items here and to turn on an LED. Which color LED glows depends upon the range value. This is implemented with following code:&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;void TSS1_fCallBack0(TSS_CONTROL_ID u8ControlId)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; (void)u8ControlId; /* avoid warning */&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; LED1_Put(TSS1_cKey0.Position&amp;lt;=20);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; LED2_Put(TSS1_cKey0.Position&amp;gt;20 &amp;amp;&amp;amp; TSS1_cKey0.Position&amp;lt;=40);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; LED3_Put(TSS1_cKey0.Position&amp;gt;40 &amp;amp;&amp;amp; TSS1_cKey0.Position&amp;lt;=64);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt;"&gt;&lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here the library provides a value in &lt;span lang="EN-US" style="font-family: 'Courier New';"&gt;TSS1_cKey0&lt;/span&gt; that has been scaled through the range of 0 through 64. You do not need to know gritty details of the algorithm that converts the slider capacitance reading into a range value that represents a position on the slider.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Touching It&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;After all of the set up work, the rest is easy: compile, download and run the code on the board. With my value arrangement, LED1 is on if I touch the slider on the left (Figure 13), LED2 is on if I touch it in the middle (Figure 14), and LED3 is on if I touch it on the right (Figure 15).&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2708/pastedImage_0.png"&gt;&lt;img alt="" class="jiveImage" height="435" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2708/313-435/pastedImage_0.png" style="width: 313px; height: 435px; display: block; margin-left: auto; margin-right: auto;" width="313"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;img class="jiveImage" style="max-width: 1200px; max-height: 900px;"/&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 13. Touch on the left: red LED lights up.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2709/pastedImage_3.png"&gt;&lt;img alt="" class="jiveImage" height="452" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2709/310-452/pastedImage_3.png" style="display: block; margin-left: auto; margin-right: auto; width: 310px; height: 452px;" width="310"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 14. Touch the slider&amp;#8217;s middle to light up the green LED.&lt;/strong&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1518-2710/pastedImage_26.png"&gt;&lt;img alt="" class="jiveImage" height="435" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1518-2710/341-435/pastedImage_26.png" style="width: 341px; height: 435px;" width="341"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 15. Touch on the right: blue LED aglow.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Using the capacitive touch capability of a device is usually not easy. However, the TSS Library Processor Expert component delivered with the Eclipse-based CodeWarrrior IDE for MCU 10.3 simplifies matters significantly. As this tutorial shows, in a few minutes you can put the touch slider on the Freescale Freedom development platform to use by just pointing and clicking, and adding a little code. Of course, there are a lot of settings that you can fine-tune (sensitivity, resolution, kind of controls), but I hope this gives you an idea what can be accomplished in a short amount of time. Additionally, there is a lot of documentation about the TSS library available &lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=TSS&amp;amp;tid=vantss"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The sources for the project discussed in this tutorial are available &lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/09/30/tutorial-touching-the-freedom-kl25z-board/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Happy Touching!&lt;/p&gt;&lt;p&gt;&lt;span class="mce_paste_marker"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img/&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:ba9cbe41-37a0-4a20-ad5d-b0df7041440a] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/p5O39C8WMSQ" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">codewarrior</category>
      <category domain="/community/the-embedded-beat/tags">mcu</category>
      <category domain="/community/the-embedded-beat/tags">sensor</category>
      <category domain="/community/the-embedded-beat/tags">sensors</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">frdm-kl25z</category>
      <pubDate>Wed, 31 Oct 2012 09:59:21 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/11/06/processor-expert-component-adds-touch-to-the-freescale-freedom-board</guid>
      <dc:date>2012-10-31T09:59:21Z</dc:date>
      <clearspace:dateToText>7 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/11/06/processor-expert-component-adds-touch-to-the-freescale-freedom-board</feedburner:origLink></item>
    <item>
      <title>Software and hardware breakpoints</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/dmd4kYTTm8o/software-and-hardware-breakpoints</link>
      <description>&lt;!-- [DocumentBodyStart:ee6fae10-f3f3-4dc5-9248-6027f4d18eff] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;By Erich Styger &lt;/strong&gt;&amp;#8212; As an embedded software developer, the use of breakpoints to debug software is a fact of life. I usually debug my applications in flash memory, because nearly all of the microcontroller units (MCUs) I use have on-chip flash memory, and quite often there is more of it available than RAM. However, debugging code in flash has its problems. One of these is that flash limits the number of breakpoints that I can use during a debugging session. This is because MCUs typically support a limited number of hardware breakpoints. If I debug the code in RAM, I can use software breakpoints, with no practical limit as to the number of them that I can use. The caveat is that code in RAM executes faster than code in flash, and so timing issues can surface when I move the finished code into flash. Given the presence of&amp;nbsp; these different breakpoint types, it is worth explaining how they are different. Armed with this knowledge, we can make better use the hardware breakpoints that are available.&lt;/p&gt;&lt;p&gt;Let me start by explaining the two types of breakpoints.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Software Breakpoints&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A &lt;em&gt;software breakpoint&lt;/em&gt; is where the debugger replaces an instruction in an embedded program with another one. The new instruction is either an illegal instruction or a dedicated breakpoint instruction that the MCU debugger hardware recognizes. Obviously, to over-write an instruction this way requires that the program reside in RAM. To illustrate how the substitution works, Figure 1 shows some code in RAM starting at address 0&amp;times;100. The LDA load instruction at the address 0&amp;times;100 is encoded as 0&amp;times;3788.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-1-code-in-ram-prior-to-setting-a-software-breakpoint1.png"&gt;&lt;img alt="Figure 1 Code in RAM prior to setting a software breakpoint" class="wp-image-9194 size-full jiveImage aligncenter" height="92" src="http://freescalehome.files.wordpress.com/2012/09/figure-1-code-in-ram-prior-to-setting-a-software-breakpoint1.png?w=316&amp;amp;h=92" title="Figure 1 Code in RAM prior to setting a software breakpoint" width="316"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 1. Code in RAM prior to setting a software breakpoint.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I want to set a breakpoint on the multiply (MULA) instruction at address 0&amp;times;102. Assume that this MCU architecture has a breakpoint instruction encoded as 0xffff. Therefore, the debugger simply writes over the opcode at address 0&amp;times;102 with the 0xffff BKPT opcode, as shown in Figure 2.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-2-code-in-ram-with-software-breakpoint-red-in-place.png"&gt;&lt;img alt="" class="size-full jiveImage aligncenter wp-image-9192" height="92" src="http://freescalehome.files.wordpress.com/2012/09/figure-2-code-in-ram-with-software-breakpoint-red-in-place.png?w=316&amp;amp;h=92" title="Figure 2 Code in RAM with software breakpoint (red) in place" width="316"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 2. Code in RAM with software breakpoint (red) in place.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When the MCU executes the code at address 0&amp;times;102, it triggers the debug module in the MCU. What the debug module does at this point is defined in the MCU reference manual. For example, the ARM Cortex architecture supports a breakpoint (BKPT) instruction. I can use this instruction in a custom function to stop the MCU.&lt;br/&gt; &lt;code&gt;&lt;br/&gt; void __attribute__((interrupt)) ISR_Unhandled(void) {&lt;br/&gt;&amp;nbsp;&amp;nbsp; asm("BKPT 255"); /* sofware breakpoint */&lt;br/&gt; }&lt;br/&gt; &lt;/code&gt;&lt;/p&gt;&lt;p&gt;When this function executes, it triggers an illegal instruction exception that the debugger module catches. This works, but debuggers can accomplish this job faster and better for the developer. When you set a software breakpoint with the debugger, it simply replaces the existing instruction at the address with a BKPT instruction. However, the debugger does a lot of hidden bookkeeping to match the specified location in the source code with the actual address in memory. Furthermore, it retains a &amp;#8220;patch list&amp;rdquo; of replaced instructions (Figure 3) so that if you later remove the breakpoint, the appropriate instruction is copied back into the corresponding address. This bookkeeping takes place behind the scenes, and allows you to focus on hunting that bug.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-3-patch-list-of-software-breakpoint-managed-by-the-debugger.png"&gt;&lt;img alt="" class="wp-image-9196 size-full jiveImage aligncenter" height="219" src="http://freescalehome.files.wordpress.com/2012/09/figure-3-patch-list-of-software-breakpoint-managed-by-the-debugger.png?w=578&amp;amp;h=219" title="Figure 3 Patch list of software breakpoint managed by the debugger" width="578"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 3. Patch list of software breakpoint managed by the debugger.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If for some reason the debugger fails to restore the original instruction, then the software breakpoint remains in place and causes an unexpected processor halt when the MCU reaches it. The debugger might report &amp;#8220;illegal breakpoint&amp;rdquo; or something similar. This situation might be caused by a board or hardware problem. Or, the debugger breakpoint list might have become corrupted. In the latter case it is best to start over and reload the application to the target embedded system.&lt;/p&gt;&lt;p&gt;The good thing about a software breakpoint is that it provides an almost unlimited number of breakpoints. Because changing instructions in RAM is easy for the debugger to perform, software breakpoints are used for applications in RAM.&lt;/p&gt;&lt;p&gt;Some debuggers even apply software breakpoints on code running in flash memory. This usually makes setting and removing breakpoints a time-consuming process, because the debugger has to erase and re-program the flash to modify the breakpoints. Other architectures implement a &amp;#8220;patch list&amp;rdquo; mechanism, similar to what is shown in Figure 2. This makes it possible to &amp;#8220;set&amp;rdquo; software breakpoints within the hardware. This lets me neatly segue into a description of &amp;#8220;real&amp;rdquo; hardware breakpoints.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Hardware Breakpoints&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To make debugging in flash memory easier to implement and manage, silicon vendors have added hardware breakpoint capabilities to their MCU cores. A typical hardware breakpoint consists of a dedicated hardware trigger that watches an internal bus or program counter, as shown in Figure 4. If the current address or counter value matches a certain condition&amp;#8212;as specified by the debugger&amp;#8212;the trigger mechanism activates the debug module. The debug module in turn stops the processor or does whatever the hardware implements for that condition.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-4-a-hardware-breakpoint-mechanism-triggering-on-an-address-match1.png"&gt;&lt;img alt="Figure 4 A hardware breakpoint mechanism triggering on an address match" class="size-full wp-image-9200 jiveImage aligncenter" height="115" src="http://freescalehome.files.wordpress.com/2012/09/figure-4-a-hardware-breakpoint-mechanism-triggering-on-an-address-match1.png?w=588&amp;amp;h=115" title="Figure 4 A hardware breakpoint mechanism triggering on an address match" width="588"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 4. A hardware breakpoint mechanism triggering on an address match.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As you might expect, dedicated hardware breakpoint triggers take up silicon on the die, so the number of hardware debug triggers available is quite limited. The ARM Cortex-M0+ at the heart of the Freescale &lt;a class="jive-link-external-small" href="http://mcuoneclipse.wordpress.com/2012/07/20/freertos-with-gcc-cortex-m0-and-kinetis-kl25z-freedom-board/"&gt;Freedom Development Platform&lt;/a&gt; is no exception to this: its &lt;a class="jive-link-external-small" href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0484b/Bcgbfdhc.html"&gt;Coresight&lt;/a&gt; module can implement a maximum of four hardware breakpoints. A good debugger supports both software and hardware breakpoints. However, that raises a question: do I have any control over what type the debugger uses?&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Choosing the Breakpoint Type&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The CodeWarrior debugger in the Eclipse IDE allows you to specify the breakpoint type. Simply right-click in the blue annotation area on the left side of the &lt;strong&gt;Editor&lt;/strong&gt; view, a drop-down menu appears, and you select what kind of breakpoint to use (Figure 5):&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-5-the-breakpoint-type-menu.png"&gt;&lt;img alt="Figure 5 The breakpoint type menu" class="size-full wp-image-9202 jiveImage aligncenter" height="196" src="http://freescalehome.files.wordpress.com/2012/09/figure-5-the-breakpoint-type-menu.png?w=588&amp;amp;h=196" title="Figure 5 The breakpoint type menu" width="588"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 5. The breakpoint type menu.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Hardware Breakpoints in Eclipse&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In Eclipse IDE, the &lt;strong&gt;Breakpoints&lt;/strong&gt; view is where you manage the list of breakpoints. This view is shown in Figure 6.&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-6-the-eclipse-ide-breakpoints-view.png"&gt;&lt;img alt="Figure 6 The Eclipse IDE Breakpoints view" class="size-full wp-image-9204 jiveImage aligncenter" height="156" src="http://freescalehome.files.wordpress.com/2012/09/figure-6-the-eclipse-ide-breakpoints-view.png?w=414&amp;amp;h=156" title="Figure 6 The Eclipse IDE Breakpoints view" width="414"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 6. The Eclipse IDE Breakpoints view.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;What happens if the target MCU has only two hardware breakpoints, but I need to set four breakpoints? In Figure 7 below, I set a breakpoint on line 41, then 42, then 43 and finally on line 40:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-7-setting-four-breakpoints.png"&gt;&lt;img alt="Figure 7 Setting four breakpoints" class="size-full jiveImage wp-image-9206 aligncenter" height="165" src="http://freescalehome.files.wordpress.com/2012/09/figure-7-setting-four-breakpoints.png?w=208&amp;amp;h=165" title="Figure 7 Setting four breakpoints" width="208"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 7. Setting four breakpoints.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;However, only two breakpoints have the check mark, which indicates the breakpoint was successfully set (Figure 8):&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-8-four-breakpoints-but-only-two-are-set.png"&gt;&lt;img alt="" class="size-full jiveImage aligncenter wp-image-9208" height="165" src="http://freescalehome.files.wordpress.com/2012/09/figure-8-four-breakpoints-but-only-two-are-set.png?w=208&amp;amp;h=165" title="Figure 8 Four breakpoints, but only two are set" width="208"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 8. Four breakpoints, but only two are set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This information appears in the &lt;strong&gt;Breakpoints&lt;/strong&gt; view (Figure 9) too:&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-9-status-of-hardware-breakpoints-in-the-breakpoints-view.png"&gt;&lt;img alt="Figure 9 Status of hardware breakpoints in the Breakpoints view" class="wp-image-9210 size-full jiveImage aligncenter" height="198" src="http://freescalehome.files.wordpress.com/2012/09/figure-9-status-of-hardware-breakpoints-in-the-breakpoints-view.png?w=588&amp;amp;h=198" title="Figure 9 Status of hardware breakpoints in the Breakpoints view" width="588"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 9. Status of hardware breakpoints in the Breakpoints view.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Obviously the debugger is using hardware breakpoints, according to the &lt;strong&gt;Type&lt;/strong&gt; column, yet only two are set successfully. Having too many breakpoints set can have some impact on debugging.&lt;/p&gt;&lt;p&gt;Note: I pay close attention to the &lt;strong&gt;Breakpoints&lt;/strong&gt; view to see if my breakpoints have the check mark set or not. Because debugging a problem with a breakpoint not set&amp;#8212;and you think that it is&amp;#8212;is not very productive. Besides displaying their status, the &lt;strong&gt;Breakpoints&lt;/strong&gt; view also allows me to closely monitor how many hardware breakpoints I have in use. Even if I have not used all of the hardware breakpoints, using a lot of them can have side effects, which I discuss next.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Running out of Hardware Breakpoints&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;If I happen to launch a debug session that uses too many breakpoints, the debugger politely points this out (Figure 10):&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-10-a-warning-that-too-many-breakpoints-are-in-use1.png"&gt;&lt;img alt="Figure 10 A warning that too many breakpoints are in use" class="size-full jiveImage aligncenter wp-image-9225" height="205" src="http://freescalehome.files.wordpress.com/2012/09/figure-10-a-warning-that-too-many-breakpoints-are-in-use1.png?w=536&amp;amp;h=205" title="Figure 10 A warning that too many breakpoints are in use" width="536"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 10. A warning that too many breakpoints are in use.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As a counter measure, Figure 11 shows how I can disable some breakpoints in the &lt;strong&gt;Breakpoints&lt;/strong&gt; view by unchecking them:&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-11-disabled-breakpoints-yellow-in-the-breakpoints-view.png"&gt;&lt;img alt="Figure 11 Disabled breakpoints (yellow) in the Breakpoints view" class="size-full wp-image-9214 jiveImage aligncenter" height="220" src="http://freescalehome.files.wordpress.com/2012/09/figure-11-disabled-breakpoints-yellow-in-the-breakpoints-view.png?w=519&amp;amp;h=220" title="Figure 11 Disabled breakpoints (yellow) in the Breakpoints view" width="519"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 11. Disabled breakpoints (yellow) in the Breakpoints view.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When all of the available hardware breakpoints are set, many debugger features still work, such as normal stepping. However, the use of all the hardware breakpoints can produce side-effects for other stepping cases. Sometimes you are simply stepping throught your code and you abruptly get rewarded with this warning (Figure 12):&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-12-what-does-a-stepping-failure-have-to-do-with-hardware-breakpoints1.png"&gt;&lt;img alt="Figure 12 What does a stepping failure have to do with hardware breakpoints" class="size-full jiveImage wp-image-9224 aligncenter" height="165" src="http://freescalehome.files.wordpress.com/2012/09/figure-12-what-does-a-stepping-failure-have-to-do-with-hardware-breakpoints1.png?w=536&amp;amp;h=165" title="Figure 12 What does a stepping failure have to do with hardware breakpoints" width="536"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 12. What does a stepping failure have to do with hardware breakpoints?&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It means that the debugger was not able to set a breakpoint. What happened?&lt;/p&gt;&lt;p&gt;When I &amp;#8220;step out&amp;rdquo; of a function, the debugger needs an extra hardware breakpoint to stop the processor once I step outside of the current function. Unfortunately, if I am using all of the hardware breakpoints, then the debugger cannot set that additional breakpoint outside of the function, and the warning appears.&lt;/p&gt;&lt;p&gt;A solution to this situation is to disable my hardware breakpoints in the &lt;strong&gt;Breakpoints&lt;/strong&gt; view while stepping. However, there is a small trick which can make my life easier.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Skipping Breakpoints Trick&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This tip does not solve all use cases, but it certainly helps in those cases where it applies. Usually the CodeWarrior debugger keeps the hardware breakpoints installed during stepping. That way, if you &amp;#8220;step over&amp;rdquo; a function which has a breakpoint set, it triggers inside that function. However, if I am comfortable in using hardware breakpoints for the stepping operation, I can tell the CodeWarrior debugger to skip breakpoints (&lt;strong&gt;Window &amp;gt; Preferences &amp;gt; Run/Debug&lt;/strong&gt;) as shown in Figure 13.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-13-skip-breakpoints-during-a-run-to-line-operation2.png"&gt;&lt;img alt="Figure 13 Skip breakpoints during a Run to Line operation" class="wp-image-9221 size-full jiveImage aligncenter" height="481" src="http://freescalehome.files.wordpress.com/2012/09/figure-13-skip-breakpoints-during-a-run-to-line-operation2.png?w=588&amp;amp;h=481" title="Figure 13 Skip breakpoints during a Run to Line operation" width="588"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 13. Skip breakpoints during a &amp;#8220;Run to Line&amp;rdquo; operation.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What this option does is to disable all my set breakpoints when I do a &amp;#8220;Run to Line&amp;rdquo; operation. This can be arranged by right-clicking a source line in the &lt;strong&gt;Editor&lt;/strong&gt; view and then choosing &lt;strong&gt;Run to Line&lt;/strong&gt; (Figure 14) in the drop-down menu.&lt;/p&gt;&lt;p&gt;&lt;a href="http://freescalehome.files.wordpress.com/2012/09/figure-14-the-run-to-line-choice-in-the-context-menu.png"&gt;&lt;img alt="Figure 14 The Run to Line choice in the context menu" class="wp-image-9222 size-full jiveImage aligncenter" height="223" src="http://freescalehome.files.wordpress.com/2012/09/figure-14-the-run-to-line-choice-in-the-context-menu.png?w=314&amp;amp;h=223" title="Figure 14 The Run to Line choice in the context menu" width="314"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Figure 14: The Run to Line choice in the context menu.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;An even easier shortcut is to place the cursor in the &lt;strong&gt;Editor&lt;/strong&gt; view, and type the &lt;strong&gt;&lt;em&gt;Ctrl+R&lt;/em&gt;&lt;/strong&gt; shortcut. With this I do not need to disable my hardware breakpoints in the &lt;strong&gt;Breakpoints&lt;/strong&gt; view, yet still can do full debugger stepping. And as a benefit, I&amp;#8217;m not tripping over my many otherwise set breakpoints.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Happy Breakpointing!&lt;/p&gt;&lt;p&gt;&lt;span class="mce_paste_marker"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:ee6fae10-f3f3-4dc5-9248-6027f4d18eff] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/dmd4kYTTm8o" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">codewarrior</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">breakpoints</category>
      <category domain="/community/the-embedded-beat/tags">hardware-breakpoints</category>
      <category domain="/community/the-embedded-beat/tags">software-breakpoints</category>
      <pubDate>Sat, 27 Oct 2012 18:46:46 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/09/17/software-and-hardware-breakpoints</guid>
      <dc:date>2012-10-27T18:46:46Z</dc:date>
      <clearspace:dateToText>7 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/09/17/software-and-hardware-breakpoints</feedburner:origLink></item>
    <item>
      <title>The Bare Metal Enthusiast: Winding the Clock</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/RXzWE6W_TsU/the-bare-metal-enthusiast-winding-the-clock</link>
      <description>&lt;!-- [DocumentBodyStart:743e3f10-6ad8-4143-ad44-2dee3f18754f] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p style="text-align: left;"&gt;&lt;strong&gt;By Derrick Klotz -- &lt;/strong&gt;&lt;span&gt;For those of us old enough to remember, a clock or watch had to be wound before it would start working. You also had to set the time. Before anything works properly in a microcontroller unit (MCU), we first need to configure its clock. As you can imagine, this is a little more complicated than spinning a knob on a watch: It involves specifying where the clock gets its source signal from (which is somewhat akin to winding it), and what output frequency it generates to drive the MCU and its peripherals (similar to setting its time).&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Frequency Multiplication&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Most MCUs employ a frequency multiplication circuit that gives you the ability to generate a high-frequency internal CPU bus speed clock from a lower-frequency input reference clock signal. This reference signal can be either internal to the MCU or an external module (typically an oscillator crystal) connected to certain pins. Deriving the CPU clock from a lower-frequency signal has the benefit in that the overall circuit generates less radio frequency interference. Since crystals that operate at slower frequencies tend to cost less than their higher-frequency counterparts, it can also reduce the parts cost of an embedded system. Quite often we can use an internal clock reference signal generated within the MCU and eliminate the external crystal altogether. Naturally, we need to consider the technical trade-offs of these options.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;As shown in Figure 1, the frequency multiplication circuit that generates the high-frequency clock signal is a closed-loop system which continually compares a scaled down version of the output frequency of a variable oscillator (F&lt;/span&gt;&lt;sub&gt;OUT&lt;/sub&gt;&lt;span&gt; &amp;#247; n) to that of an incoming reference clock source (F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt;). In a Phase-Locked Loop (PLL) implementation of the circuit, the signal comparator is a phase detector whose output signal changes relative to the phase difference between the two clock signals. In a Frequency-Locked Loop (FLL) implementation, the output of the signal comparator varies relative to the frequency difference between the two clock signals. Generally, an FLL tends to lock to the desired output frequency faster, but a PLL can have finer frequency granularity (that is, generate a wider range in output frequencies) and less clock jitter (more on that in a moment). In both cases, the output of the signal comparator creates an error signal that, through the loop filter circuit, adjusts the output of the controlled oscillator. In the circuit shown, F&lt;/span&gt;&lt;sub&gt;OUT&lt;/sub&gt;&lt;span&gt; = F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; &amp;times; n, where n represents the divide ratio value of the clock divisor.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1490-1187/figure-11.jpg"&gt;&lt;img alt="figure-11.jpg" class="jive-image" height="86" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1490-1187/507-86/figure-11.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="507"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 1.&lt;/strong&gt; &lt;strong&gt;A closed-loop frequency multiplication circuit block diagram.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;It is important to note that the output of the controlled oscillator is manipulated by an error signal and that the circuit strives to make this error zero. But once the error is zero, the oscillator's output frequency begins to change (or drift), thereby causing a non-zero error signal again. This effect causes the output frequency to fluctuate slightly over time and contributes to a parameter known as "jitter".&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;While there are several other factors involved, in general the lower the frequency of F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt;, the larger the jitter of F&lt;/span&gt;&lt;sub&gt;OUT&lt;/sub&gt;&lt;span&gt;. Conceptually, a low-frequency F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;provides fewer corrections per second than a faster F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt;. Over the long term, clock jitter generally averages out to zero, but its instantaneous affect can cause havoc with high-speed serial communications peripherals, such as Ethernet, USB and CAN. In these instances, we usually need to have an F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;of several megaHertz to minimize the clock jitter and its negative effect on the accuracy of the communication signals. This is rarely a concern when using RS232-style communications, which have much-lower frequency rates.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;A Simple Implementation&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I will use the Internal Clock Source (ICS) found in Freescale&amp;#8217;s 8-bit MC9S08PT60 MCU as a reference towards developing a more practical understanding of how to configure an MCU&amp;#8217;s clocking system. The block diagram for the external oscillator and the ICS appears in Figure 2.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1490-1188/figure-2.jpg"&gt;&lt;img alt="figure-2.jpg" class="jive-image" height="599" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1490-1188/618-599/figure-2.jpg" width="618"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 2.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;MC9S08PT60 external oscillator and internal clock source block diagram. &lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;The values at the bottom left are the status flags and control bits involved in the clock configuration.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;We can see that the ICS relies upon an FLL for reference clock frequency multiplication. The circuit shown in Figure 1 is contained entirely within the block identified as FLL in Figure 2. Inside the filter we also find the signal comparator and feedback clock divider shown in Figure 1. The output of the filter manipulates the output frequency of a digitally controlled oscillator (DCO). The LP control bit ("Low Power Select") determines whether or not the FLL circuit is operational in the ICS Bypass Modes of operation.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This FLL has been designed to accept an input reference clock (that is, F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt;) in the range between 31.25 kHz to 39.0625 kHz. It then generates an output bus clock of 16 MHz to 20 MHz that most of the MCU logic blocks use. In other words, F&lt;/span&gt;&lt;sub&gt;OUT&lt;/sub&gt;&lt;span&gt; = F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; &amp;times; 512. It is that simple. That is all it does. The rest of the circuitry shown in Figure 2 directs and controls the available input and output clocking signals.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Figure 3 shows the ICS's seven modes of operation and how we can move between these states, primarily by manipulating the IREFS and CLKS control bits. As shown in Figure 2, CLKS selects the clock source from an external oscillator, internal reference clock, or the output of the FLL. IREFS controls a signal multiplexer that selects the F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;input signal for the FLL. We can see that the options for F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;are either an internal reference clock or the output of the external oscillator after a binary divider.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1490-1189/figure-31.jpg"&gt;&lt;img alt="figure-31.jpg" class="jive-image" height="311" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1490-1189/606-311/figure-31.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="606"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 3.&lt;/strong&gt; &lt;strong&gt;State diagram of ICS clock switching modes.&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;From reset, the ICS operates in the FLL Engaged Internal (FEI) mode, which selects the FLL's output and internal reference clock as its input frequency source. It is important to note that the internal reference clock initially operates at an unknown frequency and must be trimmed.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;All S08P Family MCU devices are factory programmed with a trim value stored in flash address locations 0xFF6E and 0xFF6F. This value configures the internal reference clock for operation nominally at 32.768 kHz with an ambient temperature of approximately 20&amp;deg;C.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;For improved accuracy, the debugger interface can be instructed to measure the untrimmed frequency of the internal reference clock during the flash memory programming procedure. Based upon the desired frequency of operation (that is, between 31.25 kHz to 39.0625 kHz) a 9-bit trim value is calculated and then stored into flash memory, ordinarily at 0xFF6E and 0xFF6F. However, the trim values can be stored in other flash memory locations. This is a feature that is supported by Freescale's Processor Expert software.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;It is the responsibility of the application software to write the trim values into the corresponding ICS control registers upon reset. Listing 1 shows the C code generated by Freescale's Processor Expert Software that copies the trim values from flash memory to the appropriate ICS control registers.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[sourcecode]&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Initialize ICS_C3 register from a non volatile memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;ICS_C3 = *(uint8_t*)0xFF6FU;/* Initialize ICS_C4 register from a non volatile memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Initialize ICS_C4 register from a non volatile memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;ICS_C4 = (uint8_t)((*(uint8_t*)0xFF6EU) &amp;amp; (uint8_t)0x01U);&lt;/span&gt;&lt;br/&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;strong&gt;Listing 1: Copying the trim values into the ICS internal reference clock registers.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Once trimmed, the frequency deviation of the DCO output frequency is specified to be no worse than &amp;plusmn;2.0 percent across the full operating ambient temperature range of -40 to 105&amp;deg;C and better than &amp;plusmn;1.0 percent between 0 to 70&amp;deg;C. In order to determine whether or not this accuracy is sufficient, we need to consider the clocking needs of the MCU's peripherals, as determined by the application.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;One commonly-used peripheral with specific timing requirements is the Serial Communication Interface (SCI) used for RS-232/RS-485 communications. The clocking requirements for the SCI are normally determined by its ability to generate industry-standard baud rates. One beneficial characteristic of Freescale's SCI is that it resynchronizes its internal timing reference on every high-to-low incoming signal transition. If we do the math, we would find that this mechanism allows the worst case baud rate mismatch to be about &amp;plusmn;4.5 percent when using 8-bit formatted data. This provides some flexibility in the MCU's bus clock speed selection and easily accommodates the FLL's DCO-specified frequency deviation as indicated above.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;All industry standard SCI baud rates can be achieved by using the Internal Reference Clock and trimming it to 36.0 kHz. The FLL multiplies this by 512 resulting in a bus clock rate of 18.432 MHz. Using integer values in the SCI Baud Rate Register, the common baud rate values of 4800, 9600, 19200, 57600, and 115,200 can all be easily obtained. As specified, the worst case frequency deviation for the FLL's DCO is &amp;plusmn;2.0 percent (-40 to 105&amp;deg;C). This is sufficiently better than the required &amp;plusmn;4.5 percent, as described above. Hence, no external clock or crystal is required for applications where asynchronous serial communications dictates the most stringent timing requirements. In these situations, using the Internal Reference Clock is the practical and lowest cost option.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Some applications need the timing accuracy that can only be achieved with a crystal oscillator. The MCU's reference manual and data sheet provide the information needed to connect a crystal to its XTAL and EXTAL pins. The application software needs to first enable the External Oscillator and then wait for it to initialize and stabilize before switching modes from FEI to FEE (FLL Engaged External). Changing the IREFS bit achieves the mode switch.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The ICS has been designed to accommodate the higher frequencies commonly available for crystals. We can see in Figure 2 that the "RANGE" and "RDIV" control bits are used to configure prescale dividers that bring the external clock frequency within the range required by the FLL. Table 1 summarizes how these control bits affect the allowable crystal frequency range.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;&lt;strong&gt;Range&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;&lt;strong&gt;RDIV&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;&lt;strong&gt;Divide-by&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;&lt;strong&gt;Crystal Frequency range&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;000&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;31.25 kHz to 39.0625 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;001&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;2&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;62.5 kHz to 78.125 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;010&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;4&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;125 kHz to 156.25 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;011&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;8&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;250 kHz to 312.5 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;100&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;16&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;500 kHz to 625 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;101&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;32&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;1 MHz to 1.25 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;110&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;64&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;2 MHz to 2.5 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;111&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;128&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;4 MHz to 5MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;000&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;32&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;1 MHz to 1.25 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;001&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;64&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;2 MHz to 2.5 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;010&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;128&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;4 MHz to 5 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;011&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;256&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;8 MHz to 10 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;100&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;512&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;16 MHz to 20 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;101&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;1024&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;not supported&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;110&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;reserved&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;not supported&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="109"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="132"&gt;&lt;p align="center"&gt;111&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="156"&gt;&lt;p align="center"&gt;reserved&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="241"&gt;&lt;p align="center"&gt;not supported&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Table 1.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;RANGE and RDIV Values and their corresponding valid external frequencies.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The FLL can be bypassed using the ICS's four remaining operational modes. FLL Bypassed Internal (FBI) derives the output clock directly from the Internal Reference Clock, resulting in bus frequencies of 39.0625 kHz or slower. FLL Bypassed External (FBE) uses the External Oscillator as the clock source. In both of these modes, the FLL remains active and operational with its F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; &amp;times; 512 output available through just a simple change in the CLKS bits. If this is not required, each of these modes has a low-power option (FBILP and FBELP respectively) which disables the FLL.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Low power Stop mode can be entered from any ICS state by executing the STOP instruction. A reset or an interrupt cause the MCU to exit Stop mode. Reset places the ICS back into FEI mode. An interrupt triggers the execution of an Interrupt Service Routine (ISR); it does not change the mode. When the code returns from the ISR, it then continues operation from the point just after the STOP instruction.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;An Example&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;So far I have described using the FLL with either the Internal Clock Reference or the External Oscillator to create a bus clock in the range between 16 MHz to 20 MHz.&amp;nbsp; Sometimes we do not want to run this fast.&amp;nbsp; MCU power consumption is directly proportional to the bus speed, so when we need to save power we run the MCU at a slower speed.&amp;nbsp; Referring once again to Figure 2, we can see a bus frequency divider that is controlled by the BDIV bits.&amp;nbsp; This provides the ability to divide the clock output by 2&lt;/span&gt;&lt;sup&gt;n&lt;/sup&gt;&lt;span&gt;, where n = 0 to 7.&amp;nbsp; Doing a little math, we find that we can use the Internal Reference Clock with the FLL and get the bus speed down to 125 kHz (that is, 16 MHz &amp;#247; 128).&amp;nbsp; If that is still too fast, we can configure the CLKS control bits to bypass the FLL and use the Internal Reference Clock directly.&amp;nbsp; Now we can get all the way down to 244 Hz (that is, 31.25 kHz &amp;#247; 128). That is pretty slow. Probably too slow to be very practical, but it makes the point that the ICS gives us a wide variety of frequency options.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;One of the real benefits to using the bus frequency divider is the ability to "gear shift" the bus clock. Stated another way, when the BDIV bits change, the bus speed responds by immediately changing its frequency&amp;#8212;without missing a beat. This allows us to use a higher bus speed when we need more computational performance, and then switch to a slower frequency for reduced power operation.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;As an example, let's consider an application which:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;runs without a crystal&lt;/li&gt;&lt;li&gt;uses a high-bus speed for computational requirements&lt;/li&gt;&lt;li&gt;uses a low-bus speed for minimum power operation most of the time&lt;/li&gt;&lt;li&gt;needs to monitor and react to SCI communications that occur at 9600 baud&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;We need to figure out how fast and how slow we can run the bus to meet these criteria.&amp;nbsp; Let us start with the SCI. The minimum SCI baud rate division is the bus speed divided by 16. So the slowest bus speed with which we can still run the SCI at 9600 baud is 9600 &amp;times; 16 = 153.6 kHz. This is how fast that we'll run the bus during the minimum power operating phase. To get there we'll configure the BDIV bits to divide the FLL output by 128. Reversing the calculation gives us the required FLL output frequency: 153.6 kHz &amp;times; 128 = 19.6608 MHz. This is within the specified 16 MHz to 20 MHz range so everything looks good so far. Next we need to calculate how to get the FLL to run at 19.6608 MHz. Recall that the FLL will multiply its input signal by 512. This gives us the frequency that we need to trim the Internal Reference Clock: 19.6608 MHz &amp;#247; 512 = 38.4 kHz.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;To summarize, we will trim the Internal Reference Clock for 38.4 kHz and set BDIV for divide-by-1. This will provide a bus speed of 19.6608 MHz during the computational phase of operation. The SCI baud rate register will be configured to divide the bus speed by 128, resulting in a baud rate of 9600 (i.e., 19.6608 MHz &amp;#247; 16 &amp;#247; 128 = 9600). To make the switch to minimum power we lower the bus speed to 153.6 kHz by changing BDIV to divide-by-128. We'll also modify the SCI baud rate register for divide-by-1 so that the SCI will continue to operate at 9600 baud.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Seems pretty simple.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Lots of Clocking Options&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Now let's take a look at something a little more complex. Figure 4 is a block diagram of the Multipurpose Clock Generator (MCG) within Freescale's 32-bit ARM Cortex-M4 Kinetis Family of MCUs. This specific diagram applies to the most recent 100MHz versions of the K10, K20 and K60 MCUs.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1490-1190/figure-4.jpg"&gt;&lt;img alt="figure-4.jpg" class="jive-image" height="771" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1490-1190/597-771/figure-4.jpg" width="597"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 4.&lt;/strong&gt; &lt;strong&gt;Kinetis Multipurpose clock generator block diagram.&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;At first glance this figure may appear to be a little daunting, but most of the blocks should look familiar. We can see that there is an FLL very similar to what we saw in the ICS. The Internal Reference Clock Generator provides the same reference source with the same frequency trim range of 31.25 kHz to 39.0625 kHz. This signal is identified as the "Slow Clock" and is trimmed with the SCTRIM and SCFTRIM registers. There is also a separate "Fast Clock" created by the Internal Reference Clock Generator that is trimmed to a frequency of 4 MHz via the FCTRIM register. The Fast Clock does not feed into the FLL.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Kinetis MCUs are designed upon reset to automatically load the Internal Reference Clock Generator trim registers with pre-programmed factory-calibrated values. These configure the Slow Clock for 32.768 kHz and the Fast Clock for 4 MHz. The SCTRIM and SCFRTIM registers can be loaded by application software to trim the Slow Clock to a different frequency within its specified range. The Fast Clock can be trimmed between 3 MHz and 5 MHz by writing to the FCTRIM register. The C code generated by Freescale's Processor Expert Software that copies values into these registers from Flash appears in Listing 2 and should look familiar.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[sourcecode]&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Initialize MCG_C3 register from a non volatile memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C3 = *((uint8_t*) 0x03FFU);&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;/* Initialize MCG_C4 register from a non volatile memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C4 = (MCG_C4 &amp;amp; 0xE0U) | ((*((uint8_t*) 0x03FEU)) &amp;amp; 0x1FU);&lt;/span&gt;&lt;br/&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Listing 2. Copying the trim values into the MCG Internal Reference Clock generator registers.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The MCG also has a PLL that relies solely upon an external oscillator source for its clock reference. The input frequency range for F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; PLL is between 2 MHz and 4 MHz.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The MCG generates several clocking signals. It is important to understand how each of these are created in order to determine how we can put them to use.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;MCGIRCLK is an internal reference clock that can be sourced from either the Slow Clock or the Fast Clock of the Internal Reference Clock Generator, depending upon the setting of the IRCS control bit. MCGIRCLK is a signal available for the MCU's Low Power Timer and Touch Sense Input peripherals, thereby providing a way to keep these circuits operational during MCU low power states.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;MCGFFCLK is a fixed frequency reference that is derived from the FLL's input, F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; FLL, and provides an alternate clocking source for the MCU's FlexTimers. MCGFFCLK is synchronized with the peripheral bus clock (BUSCLK) and is only valid when its frequency is not more than one-eighth of the MCGOUTCLK frequency, otherwise it is disabled.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;MCGFLLCLK and MCFPLLCLK are the output signals of the FLL and PLL, respectively. A multiplexing selection within the MCU's System Integration Module (SIM) chooses which of these clocks serves as a timing reference option for various on-chip peripherals.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;MCGOUTCLK is the principal clock signal that drives the CPU core, the internal bus, the external FlexBus, and the flash memory. Figure 5 shows the MCG's nine modes of operation which impact the generation of the MCGOUTCLK signal. Once again we can see that the primary control bits that switch among these modes are IREFS and CLKS. These bits work much the same as they did in the ICS. PLLS is an additional control that selects between the FLL and the PLL.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1490-1191/figure-5.jpg"&gt;&lt;img alt="figure-5.jpg" class="jive-image" height="392" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1490-1191/630-392/figure-5.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="630"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 5.&lt;/strong&gt; &lt;strong&gt;State diagram of MCG clock switching modes.&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The PLLCLKEN0 control bit has the ability to enable the PLL even if it is not being selected by PLLS. This allows the system clock to be derived from the FLL while some peripherals, such as the Ethernet and USB interfaces, can be clocked from the PLL. These selection options are summarized in Table 2.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;&lt;strong&gt;PLLS&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;&lt;strong&gt;PLLCLKEN0&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;&lt;strong&gt;FLL&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;&lt;strong&gt;PLL&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;selected&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;disabled&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;selected&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;enabled&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;disabled&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;selected&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;disabled&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;selected&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Table 2.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;FLL and PLL selection and enable control using the PLLS and PLLCLKEN0 bits.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;As we can see in Figure 5, coming out of reset we are going to be in the FEI mode. Once the internal reference has been trimmed, nominally at 32.768 kHz, the default configuration for the FLL coming out of reset results in a system clock frequency of 20.97 MHz.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The FLL in the MCG provides us with more frequency multiplication options than we have with the ICS. These are selected with the DMX32 and DRS control bits and their affect on the FLL's frequency multiplication is shown in Table 3. The DMX32 bit provides us with a higher frequency multiplication option when we use the popular 32.768 kHz as a reference.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;&lt;strong&gt;DMX32&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;&lt;strong&gt;DRS&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;&lt;strong&gt;Multiply-by&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;&lt;strong&gt;F&lt;sub&gt;REF&lt;/sub&gt;FLL Frequency Range&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;&lt;strong&gt;FLL Output Range&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;640&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;31.25 kHz to 39.0625 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;20 MHz to 25 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;01&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;1280&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;31.25 kHz to 39.0625 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;40 MHz to 50 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;10&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;1920&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;31.25 kHz to 39.0625 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;60 MHz to 75 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;11&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;2560&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;31.25 kHz to 39.0625 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;80 MHz to 100 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;732&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;32.768 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;24 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;01&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;1464&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;32.768 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;48 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;10&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;2197&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;32.768 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;72MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="79"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="60"&gt;&lt;p align="center"&gt;11&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="144"&gt;&lt;p align="center"&gt;2929&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="210"&gt;&lt;p align="center"&gt;32.768 kHz&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="145"&gt;&lt;p align="center"&gt;96MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Table 3.DMX32 and DRS values and their corresponding FLL frequencies.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Under normal "set-and-forget" circumstances, configuring DMX32 and DRS is pretty straight forward. However, there may be scenarios where we want to manipulate these control bits while switching between the various MCG clock modes. In these situations we need to be careful not to select an FLL frequency multiplication option that pushes the FLL output beyond the allowable specification of the MCU.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;For improved frequency accuracy, the FLL can use an external crystal or oscillator. A prescaler unit divides down this reference signal so that it can be used as F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; FLL. The RANGE0 and FRDIV bits select the appropriate configuration for this prescaler, as shown in Table 4. The information in this table needs to be combined with the device electrical specifications to understand what kind of crystal or external oscillator can be used. Valid crystal values are in the range of 32 kHz to 40 kHz or between 3 MHz to 32 MHz, while the maximum frequency for an external clock is 50 MHz (hence, 60 MHz is greyed out in the table).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;&lt;strong&gt;RANGE0&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;&lt;strong&gt;FRDIV&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;&lt;strong&gt;Divide-by&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;&lt;strong&gt;External Frequency Range&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;000&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;31.25 kHz to 39.0625 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;001&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;2&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;62.5 kHz to 78.125 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;010&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;4&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;125 kHz to 156.25 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;011&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;8&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;250 kHz to 312.5 kHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;100&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;16&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;500 kHz to 625 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;101&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;32&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;1 MHz to 1.25 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;110&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;64&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;2 MHz to 2.5 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;00&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;111&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;128&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;4 MHz to 5MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;000&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;32&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;1 MHz to 1.25 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;001&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;64&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;2 MHz to 2.5 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;010&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;128&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;4 MHz to 5MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;011&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;256&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;8 MHz to 10 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;100&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;512&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;16 MHz to 20 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;101&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;1024&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;32 MHz to 40 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;110&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;1280&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;40 MHz to 50 MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;01 or 1x&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="160"&gt;&lt;p align="center"&gt;111&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="102"&gt;&lt;p align="center"&gt;1536&lt;/p&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="217"&gt;&lt;p align="center"&gt;48 MHz to 60MHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Table 4.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;RANGE0 and FRDIV values and their corresponding valid external frequencies.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;As I have indicated, when using high speed serial communications, we need a solid clock source that does not have a lot of jitter. It is easier to minimize the clock jitter of a frequency multiplication circuit by using a higher frequency input reference clock, F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt;. The input reference for the PLL is higher than that of the FLL. Through its clock divider, the PLL offers more frequency multiplication options, from &amp;times;24 to &amp;times;55.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;For applications using Ethernet or USB, we need to make use of the PLL. This can be accomplished by either running everything from the PLL using the MCG PLL Engaged External (PEE) mode, or by having the PLL enabled while the system clock is derived from the FLL, as per Table 2.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Another Example&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Let&amp;#8217;s look at how to engage the PEE mode operation from power on reset. Figure 5 shows us that to get to PEE, we need to move through several other states. Specifically, the shortest path through these MCG states is: FEI to FBE to PBE to PEE. As an example, I show the code required to operate the MCG in PEE while generating a 100 MHz system clock (that is, MCGOUTCLK). This technique uses an external 50 MHz oscillator as the source. This same scheme is used on Freescale's TWR-K60D100M Tower System board.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Freescale's Processor Expert Software is an excellent tool that you can use to see how to properly move between MCG states. Let&amp;#8217;s walk through this simple procedure a step at a time. The code to change from FEI to FBE is in Listing 3.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[sourcecode firstline="100"]&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Switch to FBE Mode */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* OSC_CR: ERCLKEN=1,??=0,EREFSTEN=0,??=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;OSC_CR = (uint8_t)0x80U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C7: OSCSEL=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C7 &amp;amp;= (uint8_t)~(uint8_t)0x01U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C2: LOCRE0=0,??=0,RANGE0=2,HGO0=0,EREFS0=0,LP=0,IRCS=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C2 = (uint8_t)0x20U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C1: CLKS=2,FRDIV=6,IREFS=0,IRCLKEN=1,IREFSTEN=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C1 = (uint8_t)0xBAU;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C4: DMX32=0,DRST_DRS=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C4 &amp;amp;= (uint8_t)~(uint8_t)0xE0U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C5: ??=0,PLLCLKEN0=0,PLLSTEN0=0,PRDIV0=0x0F */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C5 = (uint8_t)0x0FU;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV0=8 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C6 = (uint8_t)0x08U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Check that the source of the FLL reference clock is the external reference clock. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;while((MCG_S &amp;amp; MCG_S_IREFST_MASK) != 0x00U) {}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Wait until external reference clock is selected as MCG output */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;while((MCG_S &amp;amp; 0x0CU) != 0x08U) {}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span class="GramE"&gt;Listing 3.&lt;/span&gt; &lt;span class="GramE"&gt;Changing MCG Mode of Operation from FEI to FBE.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Line 102 - The write to OSC_CR (OSC Control Register) enables the external reference clock.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 104 - This clears the OSCSEL control bit in MCG_C7 (MCG Control 7 Register) and selects the external oscillator as the input frequency reference for the PLL.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 106 - Clearing the LP bit ensures that both the FLL and PLL remain enabled as the MCG transitions through bypass states. The RANGE0 bits in MCG_C2 control the analog biasing for the crystal oscillator and select whether or not the external reference frequency is divided by 32 prior to being fed into the FLL. As we are using an external 50 MHz oscillator (that is, not a crystal), engaging the divide-by-32 prescaler for the FLL is the more important effect of setting the RANGE0 bits. When using a crystal, the RANGE0 configuration depends upon the crystal frequency like so:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;RANGE0 = 00 :&amp;nbsp; crystal between 32 kHz and 40 kHz&lt;/li&gt;&lt;li&gt;RANGE0 = 01 :&amp;nbsp; crystal between 3 MHz and 8 MHz&lt;/li&gt;&lt;li&gt;RANGE0 = 1x :&amp;nbsp; crystal between 8 MHz and 32 MHz&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 108 - The external reference for the FLL is further divided by setting up the FRDIV bits in MCG_C1. Table 3 shows us that by setting FRDIV to 110 and with RANGE0 set to 10, we end up dividing the external 50 MHz by 1280, which produces a 39.0625 kHz signal. Also within MCG_C1, setting CLKS to 10 selects the external 50 MHz clock as the source for MCGOUTCLK, thereby bypassing the FLL.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 110 - MCG_C4 provides the frequency selection for the FLL via the DMX32 and DRS control bits. The code clears these to zero, which is their power-on reset default, so nothing gets changed.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 112 - MCG_C5 controls the prescaler for the PLL with the five PRDIV0 bits. Recall that the frequency range for the PLL's input reference, F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; PLL, is between 2 MHz and 4 MHz. The code configures PRDIV0 to 01111, which divides the 50 MHz reference by 16, and results in an F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; PLL of 3.125 MHz. The clock signal presented at F&lt;/span&gt;&lt;sub&gt;REF&lt;/sub&gt;&lt;span&gt; PLL must be within the specified frequency prior to enabling the PLL.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 114 - MCG_C6 provides some further PLL controls such as the loop clock divider with the VDIV0 bits. Setting VDIV0 to 01000 results in a multiplication factor of 32. It is important to configure these dividers while the PLL is disabled. Once it is enabled, the PLL output frequency can be calculated as: 50 MHz &amp;#247; (PRDIV0 + 1) &amp;times; (VDIV0 + 24) = 50 MHz &amp;#247; 16 &amp;times; 32 = 100 MHz.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Some control bits in the MCG do not update immediately due to internal synchronization delays. We need to wait for these controls to take effect, or we risk the possibility of running the MCG outside of its operating specifications. So what we see next in the code is two while loops that provide this delay.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 116 - The first while loop waits until the hardware verifies that the external clock has been enabled as the reference for the FLL (that is, the status of the multiplexer controlled by IREFS).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 118 - The second while loop waits for confirmation that the external clock is directly driving the MCGOUTCLK signal (that is, the status of the multiplexer controlled by CLKS).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;At this point the MCG is operating in FBE mode with the external 50 MHz oscillator directly driving the MCGOUTCLK signal. Next we need to change to PBE mode.&amp;nbsp; The code that Freescale's Processor Expert Software generates is shown in Listing 4.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[sourcecode firstline="119"]&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Switch to PBE Mode */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* OSC_CR: ERCLKEN=1,??=0,EREFSTEN=0,??=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;OSC_CR = (uint8_t)0x80U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C7: OSCSEL=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C7 &amp;amp;= (uint8_t)~(uint8_t)0x01U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C1: CLKS=2,FRDIV=6,IREFS=0,IRCLKEN=1,IREFSTEN=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C1 = (uint8_t)0xBAU;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C2: LOCRE0=0,??=0,RANGE0=2,HGO0=0,EREFS0=0,LP=0,IRCS=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C2 = (uint8_t)0x20U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C5: ??=0,PLLCLKEN0=0,PLLSTEN0=0,PRDIV0=0x0F */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C5 = (uint8_t)0x0FU;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV0=8 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C6 = (uint8_t)0x48U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Wait until external reference clock is selected as MCG output */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;while((MCG_S &amp;amp; 0x0CU) != 0x08U) {}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Wait until locked */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;while((MCG_S &amp;amp; MCG_S_LOCK0_MASK) == 0x00U) {}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;Listing 4: Changing MCG mode of operation from FBE to PBE.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;As much as I like Freescale's Processor Expert Software, I also like to point out places where it could be improved. I am a bare metal guy who is used to counting every bit, byte and clock cycle on 8-bit MCU code. I know that memory has become more affordable and 32-bit machines can tolerate a certain amount of bit-level inefficiency. But it still irks me when I see code that I consider to be simply unnecessary.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;When we compare Listing 3 and Listing 4, we find that several registers are being written twice with the same information. The writes to OSC_CR, MCG_C7, MCG_C1, MCG_C2, and MCG_C5 in Listing 4 are redundant.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 131 - Changing the PLLS control bit in MCG_C6 is the only modification needed when moving from FBE to PBE.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The first while loop in Listing 4 is also unnecessary. It is identical to the second loop shown in Listing 3. So there should be no need to perform the same check again since the CLKS bits have not been modified. More on this in a bit.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 135 - The second while loop in Listing 4 is waiting for the PLL to lock. When PLLS was set it enabled the PLL and disabled the FLL, as previously described in Table 2. Before the PLL can be used we should wait for it to lock in order to be certain that it is operating within the specifications.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;With the MCG operating in PBE mode we are ready to move into PEE mode. Listing 5 shows how this is accomplished with Freescale's Processor Expert Software.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[sourcecode firstline="136"]&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Switch to PEE Mode */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* OSC_CR: ERCLKEN=1,??=0,EREFSTEN=0,??=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;OSC_CR = (uint8_t)0x80U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C7: OSCSEL=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C7 &amp;amp;= (uint8_t)~(uint8_t)0x01U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C1: CLKS=0,FRDIV=6,IREFS=0,IRCLKEN=1,IREFSTEN=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C1 = (uint8_t)0x3AU;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C2: LOCRE0=0,??=0,RANGE0=2,HGO0=0,EREFS0=0,LP=0,IRCS=0 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C2 = (uint8_t)0x20U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C5: ??=0,PLLCLKEN0=0,PLLSTEN0=1,PRDIV0=0x0F */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C5 = (uint8_t)0x2FU;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV0=8 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;MCG_C6 = (uint8_t)0x48U;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Wait until output of the PLL is selected */&lt;/span&gt;&lt;br/&gt;&lt;span&gt;while((MCG_S &amp;amp; 0x0CU) != 0x0CU) {}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Listing 5: Changing MCG mode of operation from PBE to PEE.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Once again, the knowledge base within the Processor Expert Software has generated redundant code, specifically with the same writes to OSC_CR, MCG_C7, MCG_C2, MCG_C5, and MCG_C6.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 142 - The only change actually required is the modification of the CLKS bits in MCG_C1 so that the output of the PLL now drives MCGCLKOUT.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Line 150 - The last while loop verifies that the CLKS bits did change before proceeding.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The redundant code in Listings 4 and 5 is not wrong. Processor Expert software is working to a narrow scope and simply makes no assumptions about previous MCG register settings, and therefore creates more code than is necessary. This is not a big deal: Wasting a few bytes of flash memory and a few cycles of processor time probably doesn&amp;#8217;t matter. However, it does bug me and my 8-bit minimalistic sensibility.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I would go in and fix it, but the code generated should not be modified manually, as the Processor Expert tools will regenerate it upon every recompile. You can modify settings to disconnect the code so that it will no longer be generated &amp;#8211; in effect use Processor Expert software to get you started, and then take over. But that&amp;#8217;s another article.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I like using Freescale's Processor Expert Software because it saves a lot of time when we need to get an MCU up and running in a hurry. I remember using complete data books for 8-bit MCUs that were around 100 pages long. Today, the reference manuals for some of the simplest 32-bit devices exceed 1000 pages and those that document their more complex relatives are twice that size or more. That's a lot of information to learn within the ever-shortening project design timeframes.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;For me, block diagrams are the best way to quickly understand how a module works. As MCU clocking options have grown in complexity, tools like Freescale's Processor Expert Software have become more important. Looking at the code it generates and comparing it to the corresponding information in the MCU's reference manual helps you understand the bare metal workings of the device. This is often much easier than the other way around - that is, the traditional way of writing code based solely upon the information provided in the device reference manual, bit-banging the registers, and hoping that the proper frequency comes out.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;When it comes to software development, efficiency can be measured in terms of the size of the code and/or the time it takes to create it. I have to admit that lately I have been running out of time more often than bytes.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:743e3f10-6ad8-4143-ad44-2dee3f18754f] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/RXzWE6W_TsU" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">kinetis</category>
      <category domain="/community/the-embedded-beat/tags">hcs08</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">c-programming</category>
      <category domain="/community/the-embedded-beat/tags">clocks</category>
      <category domain="/community/the-embedded-beat/tags">mcu-clock</category>
      <category domain="/community/the-embedded-beat/tags">programming</category>
      <category domain="/community/the-embedded-beat/tags">timer</category>
      <pubDate>Tue, 21 Aug 2012 05:08:04 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/08/20/the-bare-metal-enthusiast-winding-the-clock</guid>
      <dc:date>2012-08-21T05:08:04Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/08/20/the-bare-metal-enthusiast-winding-the-clock</feedburner:origLink></item>
    <item>
      <title>Eclipse working sets revealed</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/jCRtKx4Y8tY/eclipse-working-sets-revealed</link>
      <description>&lt;!-- [DocumentBodyStart:66e34ead-2e77-45eb-addd-e839f5a428df] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;By Erich Styger --&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;The CodeWarrior IDE is based on the Eclipse framework, and is project based. The&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;CodeWarrior Projects&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view shows you your projects, and their contents. However, over time more projects pile up in my workspace, and more resources accompany these projects. You reach a point where, despite the IDE's many views, the number of elements displayed becomes overwhelming. When I have a lot of projects, I do not want to switch between workspaces too often. Yes, I can open and close projects, but this gets cumbersome too. Thankfully, the Eclipse IDE provides a solution: Working Sets.&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;A Working Set is a group of projects I want to work on at the same time. They are, at least in my mind, related to each other, so I put them together in a collection. Note that working sets are&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;not&lt;/em&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;the same as CodeWarrior subprojects: My article,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1446" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2012/03/20/codewarrior-tool-tip-5-the-return-of-the-subproject"&gt;CodeWarrior Tool Tip #5: The return of the subproject&lt;/a&gt;&lt;span&gt;, explains what subprojects are. The projects in a working set are related in a looser way.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Since I often use many projects at the same time, working sets allows me to focus on the right set of elements at the right time. Better still, I can operate on the projects that belong to the working set. I can define a set of things I want to look at, and then work with them. Working sets allow me to be more productive in my environment.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Building&amp;nbsp; a Working Set&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;One valuable feature of working sets is that I can quickly and accurately build a set of projects. Otherwise I must manually select a set of projects and then compile them all at once, or do them one at a time sequentially. A working set acts as a container that holds the projects I need to operate on. When I request a build on the working set, the IDE builds all of the projects held within it.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p align="center" style="text-align: justify;"&gt;Making a working set is simple.&amp;nbsp; I use &lt;strong&gt;Project &amp;gt; Build Working Set &amp;gt; Select Working Set&lt;/strong&gt; to create or change working sets (Figure 1):&lt;/p&gt;&lt;p align="center" style="text-align: justify;"&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1193/figure-1-menu-choice-to-choose-a-working-set.png"&gt;&lt;img alt="figure-1-menu-choice-to-choose-a-working-set.png" class="jive-image" height="233" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1193/540-233/figure-1-menu-choice-to-choose-a-working-set.png" width="540"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;strong&gt;Figure 1. Menu choice to choose a working set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;If I do not have a working set defined, then the following dialog appears, which allows me to click&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;New&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;and create a new one (Figure 2):&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1194/figure-2-creating-a-working-set.png"&gt;&lt;img alt="figure-2-creating-a-working-set.png" class="jive-image" height="352" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1194/388-352/figure-2-creating-a-working-set.png" width="388"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 2. Creating a Working Set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Now I need to tell the IDE how to handle the projects contained in the working set. That is, I specify the working set's type. So, to create a working set of related C/C++ projects, I choose&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;C/C++&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;and click&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Next&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(Figure 3):&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1195/figure-3-specifying-the-type-of-projects-in-a-working-set.png"&gt;&lt;img alt="figure-3-specifying-the-type-of-projects-in-a-working-set.png" class="jive-image" height="370" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1195/458-370/figure-3-specifying-the-type-of-projects-in-a-working-set.png" style="display: block; margin-left: auto; margin-right: auto;" width="458"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 3. Specifying the type of projects in a working set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Next I enter a name for my working set, select the project(s) held in it, and click&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Finish&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(Figure 4). The projects listed are those available in the Explorer view.&lt;/span&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1196/figure-4-defining-a-working-set.png"&gt;&lt;img alt="figure-4-defining-a-working-set.png" class="jive-image" height="387" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1196/458-387/figure-4-defining-a-working-set.png" width="458"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 4. Defining the projects that belong to the working set.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p align="center" style="text-align: justify;"&gt;To build my set of projects, I first select the working set I want to use&amp;#8212;for this example, Test set&amp;#8212;and click &lt;strong&gt;OK&lt;/strong&gt; (Figure 5):&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1197/figure-5-choosing-the-work-set-for-the-ide-to-operate-on.png"&gt;&lt;img alt="figure-5-choosing-the-work-set-for-the-ide-to-operate-on.png" class="jive-image" height="352" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1197/388-352/figure-5-choosing-the-work-set-for-the-ide-to-operate-on.png" style="display: block; margin-left: auto; margin-right: auto;" width="388"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 5 Choosing the work set for the IDE to operate on&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;When I click OK the IDE dutifully compiles and links all of the projects associated with&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;Test set&lt;/code&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The example in this article is simple. Wait until you are dealing with lots of projects that have lots of files. Freescale&amp;#8217;s&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1279" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2011/04/20/writing-real-solutions-for-real-time-using-mqx"&gt;MQX RTOS&lt;/a&gt;&lt;span&gt;, for example, has a working set that encompasses its kernel, shell, board support package, and various software stacks, such as a file system and assorted USB classes. The RTOS source consists of seven projects, each which can have hundreds of files. To modify MQX for your embedded system, you edit some values in a&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;user_config.h&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;file and then have the Eclipse IDE build the MQX working set. Working sets make such changes not only manageable, but easy.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Search in a Working Set&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;It is possible to limit the IDE's search mechanism to that of a working set. For this I can choose a working set as scope in the search dialogs (Figure 6):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1198/figure-6-setting-scope-of-search-to-a-working-set.png"&gt;&lt;img alt="figure-6-setting-scope-of-search-to-a-working-set.png" class="jive-image" height="427" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1198/572-427/figure-6-setting-scope-of-search-to-a-working-set.png" style="display: block; margin-left: auto; margin-right: auto;" width="572"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 6. Setting scope of search to a working set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Managing Working Sets&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;To manage working sets, I first press CTRL+3 to display the IDE's&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Quick Access&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;dialog (Figure 7), then type&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;working set&lt;/code&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1199/figure-7-choosing-manage-working-sets-from-quick-access.png"&gt;&lt;img alt="figure-7-choosing-manage-working-sets-from-quick-access.png" class="jive-image" height="244" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1199/449-244/figure-7-choosing-manage-working-sets-from-quick-access.png" style="display: block; margin-left: auto; margin-right: auto;" width="449"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 7. Choosing Manage Working Sets from Quick Access.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;From this dialog, a keystroke or two takes me to the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Manage Working Set Configurations&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;dialog (Figure 8):&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1200/figure-8-selecting-launch-configurations-for-projects-in-the-working-set.png"&gt;&lt;img alt="figure-8-selecting-launch-configurations-for-projects-in-the-working-set.png" class="jive-image" height="508" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1200/379-508/figure-8-selecting-launch-configurations-for-projects-in-the-working-set.png" style="display: block; margin-left: auto; margin-right: auto;" width="379"/&gt;&lt;/a&gt;&amp;nbsp; &lt;strong&gt;Figure 8. Selecting launch configurations for projects in the working set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Here I can see how each project in the working set is built. I can create new and different configurations: ways of building this working set, and make any one of them the active configuration.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Project View Filtering with Working Sets&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I can filter the projects displayed in the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;CodeWarrior Project&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view through the use of working sets. For this I click on the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;View Menu&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;item (the small triangle in the corner of the view) and either select/define a working set, or choose an existing one from the most recently used sets, as Figure 9 shows.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;strong&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1201/figure-9-selecting-the-working-sets-to-display.png"&gt;&lt;img alt="figure-9-selecting-the-working-sets-to-display.png" class="jive-image" height="218" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1201/534-218/figure-9-selecting-the-working-sets-to-display.png" width="534"/&gt;&lt;/a&gt; &lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 9. Selecting the working sets to display.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;This feature lets me easily focus on a subset of projects that I am working with, as shown in Figure 10.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1202/figure-10-project-view-displaying-only-the-chosen-working-set.png"&gt;&lt;img alt="figure-10-project-view-displaying-only-the-chosen-working-set.png" class="jive-image" height="188" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1202/320-188/figure-10-project-view-displaying-only-the-chosen-working-set.png" width="320"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 10. Project view displaying only the chosen working set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt; TIP:&amp;nbsp; I often use working sets to reduce the number of workspaces that I use. Instead of having projects scattered over different workspaces, I can keep them in one workspace and use working sets to present only those projects that I am interested in. Besides keeping the information at manageable level, there is an added benefit of using working sets:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1395" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2011/11/10/codewarrior-tool-tip-1-improve-performance-by-cleaning-house-in-the-eclipse-workspace"&gt;having fewer projects open at the same time in Eclipse enables the IDE to operate faster&lt;/a&gt;&lt;span&gt;.&amp;nbsp; With working sets, I can switch quickly between the collections of projects that I am working on.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;However, the value of working sets does not stop at filtering projects. You can even filter objects&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;inside&lt;/em&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;the project as well. I simply deselect things I do not want to see, which lets me focus on what is important. For example, Figure 11 shows where the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;CodeWarrior Project&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view only displays a project&amp;#8217;s&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;Source&lt;/code&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;Header&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;and generated output (&lt;/span&gt;&lt;code&gt;MCF51JM128_Internal_Flash&lt;/code&gt;&lt;span&gt;) folders.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1203/figure-11-filtering-project-files.png"&gt;&lt;img alt="figure-11-filtering-project-files.png" class="jive-image" height="515" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1203/300-515/figure-11-filtering-project-files.png" width="300"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 11. Filtering project files.&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Export and Import of Working Sets&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;So far what we have been discussing is essentially standard Eclipse functionality as it applies in the CodeWarrior IDE &amp;#8211; such as our extensions of the Project explorer to adapt to the CodeWarrior project file. The export and import of working sets is not standard, but some people have implemented this capability, including Freescale.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;You can get this feature when you install either&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/mqx"&gt;MQX RTOS with its MQX plugins&lt;/a&gt;&lt;span&gt;, or with the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://andrei.gmxhome.de/anyedit/index.html"&gt;AnyEdit&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;plugins .&lt;/span&gt;&lt;/p&gt;&lt;p align="center" style="text-align: left;"&gt;After installing the MQX plugin, to export a working set, I choose &lt;strong&gt;File &amp;gt; Export &amp;gt; Other &amp;gt; Export Working Set&lt;/strong&gt; (Figure 12):&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1204/figure-12-the-mqx-plugin-being-used-to-export-a-working-set.png"&gt;&lt;img alt="figure-12-the-mqx-plugin-being-used-to-export-a-working-set.png" class="jive-image" height="453" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1204/451-453/figure-12-the-mqx-plugin-being-used-to-export-a-working-set.png" width="451"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 12. The MQX plugin being used to export a working set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;This gives the following dialog (Figure 13) where I can specify the file name and the root of projects:&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1205/figure-13-export-working-set-dialog.png"&gt;&lt;img alt="figure-13-export-working-set-dialog.png" class="jive-image" height="368" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1205/495-368/figure-13-export-working-set-dialog.png" width="495"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 13. Export working set dialog.&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;This saves the working set information into an XML file. You import the working set by selecting &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;File &amp;gt; Import &amp;gt; Other &amp;gt; Import Working Set&lt;/strong&gt;&lt;span&gt;, and then opening the XML file. The MQX plugins also allow the drag and drop of the exported working set file into&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;CodeWarrior Project&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view, where the Eclipse IDE then restores the working set information.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The AnyEdit plugins provide a wizard to handle the import and export of working sets. Finally, the format of the AnyEdit stored working set information differs from that made by the MQX plugin implementation, so you cannot mix the two.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Tip: I use the extension&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;*.wsd&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for designating the file that stores working set information. That way I can simply drag and drop the file into Eclipse IDE to import it.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Other Kinds of Working Sets&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;As Figure 14 shows, the use of working set information does not stop at projects and files.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1206/figure-14-selecting-a-working-set-type.png"&gt;&lt;img alt="figure-14-selecting-a-working-set-type.png" class="jive-image" height="361" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1206/455-361/figure-14-selecting-a-working-set-type.png" width="455"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 14. Selecting a working set type.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;I can create working sets of breakpoints or analysis/trace points. I can create working sets of any resource files or tasks. The possibilities are nearly endless and can also depend on the plugins installed.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Window Working Sets&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;OK, so you have the idea that a working set can control many elements in the Eclipse IDE: collections of projects, visibility of files in the project, what gets built, breakpoints, resources, and so on. Many different views and dialogs have a workspace setting. The problem is that each view is independent and can have a different working set. Keeping them consistent can be a challenge.&amp;nbsp; For example, in Figure 15, on the left I use a working set &amp;lsquo;ColdFire&amp;#8217; for the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;CodeWarrior Projects&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view, but my&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Search&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;dialog on the right has a &amp;lsquo;Kinetis&amp;#8217; working set configured.&lt;/span&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1207/figure-15-choosing-window-working-set.png"&gt;&lt;img alt="figure-15-choosing-window-working-set.png" class="jive-image" height="347" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1207/388-347/figure-15-choosing-window-working-set.png" width="388"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 15. Two different working sets in use.&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Sometimes I want this arrangement, but not always. What I need is a &amp;lsquo;global&amp;#8217; working set. And here is where the Window Working Sets comes to the rescue.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;When you made your first working set, you might have noticed the option for&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Window Working Sets&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(Figure 16). What are they, and what can they be used for?&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1208/figure-16-two-different-working-sets-in-use1.png"&gt;&lt;img alt="figure-16-two-different-working-sets-in-use1.png" class="jive-image" height="289" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1208/604-289/figure-16-two-different-working-sets-in-use1.png" width="604"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;strong&gt;Figure 16. Choosing to use the Window Working Set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;You can say that an individual view will use the Window Working Set. But what is the Window Working Set?&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I can add menu and icon items to set and switch the Window Working Set right at the top level of the UI. First, I choose&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Window &amp;gt; Customize Perspective&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(Figure 17). Next, I select the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Command Groups&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tab, and enable the option&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Window Working Set&lt;/strong&gt;&lt;span&gt;. It is a good idea to enable the option&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Working Set Manipulation&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;as well. When you select each one, the other columns tell you what menu items appear in which menu, and what icon will appear in the tool bar.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&amp;nbsp; &lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1209/figure-17-choosing-window-working-set-commands1.png"&gt;&lt;img alt="figure-17-choosing-window-working-set-commands1.png" class="jive-image" height="429" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1209/584-429/figure-17-choosing-window-working-set-commands1.png" width="584"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 17. Choosing Window Working Set commands&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;To control visibility, you can go to the Tool Bar Visibility and Menu Visibility tabs. Since you just turned on the command group, the icon and menu items should be on by default. The result is an icon on the toolbar that lets me quickly set the Window Working Set, or to Edit the working set (Figure 18):&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1210/figure-18-configuring-working-set-toolbars.png"&gt;&lt;img alt="figure-18-configuring-working-set-toolbars.png" class="jive-image" height="129" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1210/144-129/figure-18-configuring-working-set-toolbars.png" width="144"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 18. Configuring working set from the toolbar.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;I can do the same from the Window menu as well (Figure 19):&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1211/figure-19-menu-access-to-working-sets.png"&gt;&lt;img alt="figure-19-menu-access-to-working-sets.png" class="jive-image" height="377" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1211/351-377/figure-19-menu-access-to-working-sets.png" width="351"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 19. Menu access to working sets.&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p align="center" style="text-align: left;"&gt;In an individual view (Figure 20), I can say I want to use&amp;nbsp; the &lt;strong&gt;Window Working Sets&lt;/strong&gt; instead of selecting a particular working set:&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1212/figure-20-selecting-the-global-window-working-set.png"&gt;&lt;img alt="figure-20-selecting-the-global-window-working-set.png" class="jive-image" height="336" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1212/388-336/figure-20-selecting-the-global-window-working-set.png" width="388"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 20. Selecting the global Window Working Set.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Now my working set settings can be shared and common for all views. If I switch the Window Working Set, the IDE changes the display for all views where I have set the view to use the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Window Working Set&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(Figure 21):&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p align="center" style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1488-1213/figure-21-window-working-set-applied-to-multiple-views.png"&gt;&lt;img alt="figure-21-window-working-set-applied-to-multiple-views.png" class="jive-image" height="279" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1488-1213/584-279/figure-21-window-working-set-applied-to-multiple-views.png" width="584"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 21. Window Working Set applied to multiple views.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;This ensures that my working set configuration is the same across views, and I can switch between different settings with just a mouse click.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Working sets are an extremely powerful feature that allows you to focus on a subset of elements inside the Eclipse environment. As with many great Eclipse features, you do not really appreciate their power until you become aware them and are shown how to use them. Who knows how many other hidden treasures are buried in the Eclipse framework?&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I hope this article can save you a few mouse clicks, plus make organizing and managing your embedded system code much easier.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Happy Work-Setting!&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:66e34ead-2e77-45eb-addd-e839f5a428df] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/jCRtKx4Y8tY" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">codewarrior</category>
      <category domain="/community/the-embedded-beat/tags">mqx</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">eclipse</category>
      <category domain="/community/the-embedded-beat/tags">mqx-rtos</category>
      <category domain="/community/the-embedded-beat/tags">eclipse-ide</category>
      <category domain="/community/the-embedded-beat/tags">codewarrior-tools</category>
      <category domain="/community/the-embedded-beat/tags">eclipse-views</category>
      <category domain="/community/the-embedded-beat/tags">ide-features</category>
      <category domain="/community/the-embedded-beat/tags">working-sets</category>
      <pubDate>Wed, 15 Aug 2012 01:27:40 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/08/14/eclipse-working-sets-revealed</guid>
      <dc:date>2012-08-15T01:27:40Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/08/14/eclipse-working-sets-revealed</feedburner:origLink></item>
    <item>
      <title>Boundary-scan testing quickly done</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/FjheWRaamnM/boundary-scan-testing-quickly-done</link>
      <description>&lt;!-- [DocumentBodyStart:4bc31b0c-2d36-43b3-be5b-8eabd2a912e2] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;By Tom Thompson --&lt;/strong&gt;&lt;strong&gt; &lt;/strong&gt;&lt;span&gt;In a previous blog article, I described&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1470" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2012/06/12/executing-boundary-scan-hardware-tests-with-a-freescale-tap"&gt;how you can perform automated hardware tests on an embedded systems board that's based on a QorIQ processor&lt;/a&gt;&lt;span&gt;. You can do this easily in a matter of minutes with just a Freescale TAP run controller and a test application. The test application,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.corelis.com/runner-lite/QorIQ.php"&gt;Runner-Lite&lt;/a&gt;&lt;span&gt;, was written by&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.corelis.com/index.htm"&gt;Corelis Inc.&lt;/a&gt;&lt;span&gt;,&amp;nbsp; and makes use of the boundary-scan capability built into the JTAG interface of the Freescale TAP probe and the microprocessor unit (MPU) to conduct these tests and present the results graphically.&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This sounds all well and good, but how difficult is it to actually perform these tests? Or, put another way, can we have a reality check here? I decided to find out. Working at Freescale, you can get your hands on some neat stuff. So it was that I was able to come into possession of a P1024RDB board. Next I went through my assorted cables and emulator pods to locate a&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=USBTAP&amp;amp;nodeId=0152102726E4D6E4E3"&gt;Freescale USB TAP&lt;/a&gt;&lt;span&gt;. The label on its housing declared that the probe is a revision A design, which makes it about five years old. Besides the board and the emulator pod, the only other gear required is a workstation that can execute the Runner-Lite application. The complete set up for performing a boundary-scan appears in Figure 1.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1487-1214/figure-1-the-cast-of-chars3.jpg"&gt;&lt;img alt="figure-1-the-cast-of-chars3.jpg" class="jive-image" height="361" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1487-1214/481-361/figure-1-the-cast-of-chars3.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="481"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 1. The cast of characters for conducting boundary-scan tests.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;It took a few minutes to remove the protective housing surrounding the P1024RDB board, and a minute to locate the J22 connector that the JTAG/COP cable from the TAP run controller plugs into. Wait, I spent another three minutes double-checking that I had the cable oriented in the connector correctly. I didn't want any pyrotechnics from plugging the cable in the wrong way.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Now for the software. I had the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW_DSPA&amp;amp;tid=CWH"&gt;CodeWarrior Development Studio v10 for Power Architecture&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tools already installed, which meant that the CodeWarrior Command Server (CCS), the software driver that communicates with the TAP, was in place. Next, I went to the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.corelis.com/runner-lite/QorIQ.php"&gt;Corelis web site&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;and downloaded the Runner-Lite application. I then registered and was able to download the P1024RDB test plan file. Note that the Runner-Lite application requires the information stored in the test plan file in order to run the tests. If you want Runner-Lite files to test a different board, all you do is load a different test plan file.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Installing the Runner-Lite application took a few more minutes, and I had it read in the P1024RDB test plan file. I applied power to the board. No sparks flew or smoke gushed...good. Then I made a few menu selections, and had the Runner-Lite application test the board. The entire test suite&amp;#8212;excluding external loop back tests&amp;#8212;ran in just over a minute. Ignoring software installation times, I had boundary-scan tests going in about ten minutes.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If your board has hardware problems, the Runner-Lite application flags them and points them out to you. If the board passes muster, you can quit the Runner-Lite application and launch the CodeWarrior tools to begin downloading and testing code using the same set up. In summary, you can use the same gear to conduct boundary scan tests on prototype hardware, then perform board bring up on the prototype. Then you can conduct more boundary scans, and finally develop the applications that execute on the board. Also note that I was using a (relatively) old emulator pod and Windows XP, so you don't need the latest and greatest equipment to do hardware tests and develop software for your embedded system prototype. To see how easy it is to get started, the equipment set up is summarized in this video, and it also presents a test run with the Runner-Lite application.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;iframe frameborder="0" height="350" src="http://www.youtube.com/embed/lVZ4Fdm_jX4?wmode=transparent" width="425"&gt;
&lt;/iframe&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This is truly a sweet arrangement. As it turns out, testing boundaries doesn&amp;#8217;t always involve pushing technical boundaries. &lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:4bc31b0c-2d36-43b3-be5b-8eabd2a912e2] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/FjheWRaamnM" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">qoriq</category>
      <category domain="/community/the-embedded-beat/tags">jtag</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">boundary-scan</category>
      <category domain="/community/the-embedded-beat/tags">corelis</category>
      <category domain="/community/the-embedded-beat/tags">emulator-probe</category>
      <category domain="/community/the-embedded-beat/tags">runner-lite</category>
      <category domain="/community/the-embedded-beat/tags">run-controller</category>
      <category domain="/community/the-embedded-beat/tags">usb-tap</category>
      <pubDate>Tue, 07 Aug 2012 05:31:45 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/08/06/boundary-scan-testing-quickly-done</guid>
      <dc:date>2012-08-07T05:31:45Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/08/06/boundary-scan-testing-quickly-done</feedburner:origLink></item>
    <item>
      <title>Accelerometer placement - where and why</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/amdrN7qjVPo/accelerometer-placement--where-and-why</link>
      <description>&lt;!-- [DocumentBodyStart:b606f669-53bc-4232-b756-2eedb7c144b6] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;By Michael Stanley&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;#8211; A question that should be asked during physical design of any product incorporating sensors is: "Where should be sensors be located within the product?" Like almost anything else in life, "It depends ... " is the answer. This post discusses accelerometer placement. We'll touch on magnetic sensors next time around.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If your application is such that the sensor is statically fixed in space, or at least not rotating, it doesn't really matter where you mount the accelerometer on your board. But if the device can rotate, things get a lot more interesting.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;The&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;rate of change transport theorem&lt;/strong&gt;&lt;span&gt;, which can be found in any rigid body dynamics textbook, relates the rate of change of a vector &lt;/span&gt;&lt;strong&gt;r&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;as observed in two different reference frames.&amp;nbsp; For our purposes, the first is the fixed (earth) frame and the second (body frame) rotates and translates relative to the first.&amp;nbsp; In equation form:&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;(d&lt;strong&gt;r&lt;/strong&gt;/dt)&lt;sub&gt;f&lt;/sub&gt; =(d&lt;strong&gt;r&lt;/strong&gt;/dt)&lt;sub&gt;r&lt;/sub&gt; + &amp;omega; X &lt;strong&gt;r&lt;/strong&gt;&lt;sub&gt;r&lt;/sub&gt; (Eqn. 1)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;where the subscripts indicate the frame of reference.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;The transport theorem is a fundamental relationship, based upon basic principles of geometry.&amp;nbsp; It applies to ANY vector observable from two independent reference frames.&amp;nbsp; You should note that both left and right sides of the equation are vectors.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;We are going to repeatedly apply the transport theorem to derive a relationship defining the acceleration of an object in the fixed earth frame based upon sensor measurements made in the body frame.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In graphical form, consider movable point "P", observable from two different frames of reference.&amp;nbsp; "O&lt;sub&gt;f&lt;/sub&gt;" is the origin of the fixed earth reference frame. "O&lt;sub&gt;r&lt;/sub&gt;" is the origin of the rotating reference frame.&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1484-1215/for11.jpg"&gt;&lt;img alt="for11.jpg" class="jive-image" height="366" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1484-1215/408-366/for11.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="408"/&gt;&lt;/a&gt;&lt;em&gt;Frames of Reference&lt;/em&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;By basic geometry&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;r' = R + r&amp;nbsp; (Eqn. 2)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;Note that&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;V = (dr/dt)&lt;sub&gt;f&lt;/sub&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;V is the rate of change of vector r as viewed in the fixed reference frame.&amp;nbsp; It can also be viewed as the velocity of P as viewed in the fixed earth frame&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;V&lt;sub&gt;r&lt;/sub&gt; = (dr/dt)&lt;sub&gt;r&lt;/sub&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;V&lt;sub&gt;r&lt;/sub&gt; is the he rate of change of vector r as viewed in the rotating reference frame.&amp;nbsp; It can also be viewed as the velocity of P as viewed within the rotating reference frame.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&amp;omega; = the angular velocity of the rotating frame relative to the fixed earth frame&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;by differentiating Eqn. 2, we get&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;(dr'/dt)&lt;sub&gt;f&lt;/sub&gt; = (dR/dt)&lt;sub&gt;f&lt;/sub&gt; + (dr/dt)&lt;sub&gt;f&lt;/sub&gt;&amp;nbsp;&amp;nbsp; (Eqn. 3)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;which we can also write as&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;V&lt;sub&gt;r'&lt;/sub&gt; = V + (dr/dt)&lt;sub&gt;f&lt;/sub&gt;&amp;nbsp; (Eqn. 4)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;The quantity V can be interpreted as the translational velocity of the rotating frame relative to the fixed frame of reference.&amp;nbsp; V&lt;sub&gt;r'&lt;/sub&gt; is the velocity of point P as observed in the fixed earth frame.&amp;nbsp; Typically, this is the quantity we are trying to measure.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;We can apply the transport theorem to the right most term in Eqn. 4 to get&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;V&lt;sub&gt;r'&lt;/sub&gt; = V + &lt;span style="color: #ff0000;"&gt;(d&lt;strong&gt;r&lt;/strong&gt;/dt)&lt;sub&gt;r&lt;/sub&gt; + &amp;omega; X &lt;strong&gt;r&lt;/strong&gt; &lt;/span&gt; (Eqn. 5)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;V&lt;sub&gt;r'&lt;/sub&gt; = V + &lt;span style="color: #ff0000;"&gt;V&lt;sub&gt;r&lt;/sub&gt;&lt;/span&gt; + &amp;omega; X &lt;strong&gt;r&lt;/strong&gt;&amp;nbsp; (Eqn. 6)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;Now differentiate and take advantage of the math identity:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;d/dt (A X B) = (dA/dt X B) + (A X dB/dt)&amp;nbsp;&amp;nbsp; (Eqn. 7)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;to get&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;span style="color: #ff0000;"&gt;A&lt;sub&gt;r&amp;#8217;&lt;/sub&gt; =&amp;nbsp; (dV&lt;sub&gt;r'&lt;/sub&gt;/dt)&lt;sub&gt;f&lt;/sub&gt; =&amp;nbsp; (dV/dt)&lt;sub&gt;f&lt;/sub&gt; + (dV&lt;sub&gt;r&lt;/sub&gt;/dt)&lt;sub&gt;f&lt;/sub&gt; + (d&amp;omega;/dt)&lt;sub&gt;f&lt;/sub&gt; X r + &amp;omega; X (dr/dt)&lt;sub&gt;f&lt;/sub&gt; &lt;/span&gt;&amp;nbsp; (Eqn. 8)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;Let&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A = (dV/dt)&lt;sub&gt;f&lt;/sub&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;where &lt;strong&gt;A&lt;/strong&gt; is the acceleration of the second frame of reference relative to the fixed earth frame.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;At the same time, apply the transport theorem again to substitute&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;(dV&lt;sub&gt;r&lt;/sub&gt;/dt)&lt;sub&gt;f&lt;/sub&gt; =(dV&lt;sub&gt;r&lt;/sub&gt;/dt)&lt;sub&gt;r&lt;/sub&gt;+ &amp;omega; X V&lt;sub&gt;r&lt;/sub&gt; (Eqn. 9)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;to get&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A&lt;sub&gt;r&amp;#8217;&lt;/sub&gt; =&amp;nbsp; &lt;span style="color: #ff0000;"&gt;A&lt;/span&gt;+ &lt;span style="color: #ff0000;"&gt;(dV&lt;sub&gt;r&lt;/sub&gt;/dt)&lt;sub&gt;r&lt;/sub&gt;+ &amp;omega; X V&lt;sub&gt;r&lt;/sub&gt;&lt;/span&gt;+ (d&amp;omega;/dt)&lt;sub&gt;f&lt;/sub&gt; X r + &amp;omega; X (dr/dt)&lt;sub&gt;f&lt;/sub&gt;&amp;nbsp;&amp;nbsp; (Eqn. 10)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;Let&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&amp;#945; = (d&amp;omega;/dt)&lt;sub&gt;f&amp;nbsp; &lt;/sub&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;where &amp;#945; is the rate of angular acceleration, and&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A&lt;sub&gt;r&lt;/sub&gt; =&amp;nbsp; (dV&lt;sub&gt;r&lt;/sub&gt;/dt)&lt;sub&gt;r&lt;/sub&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;where A&lt;sub&gt;r&lt;/sub&gt; is the rate of acceleration of P relative to O&lt;sub&gt;r&lt;/sub&gt;.&amp;nbsp; Then&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A&lt;sub&gt;r&amp;#8217;&lt;/sub&gt; =&amp;nbsp; A+ &lt;span style="color: #ff0000;"&gt;A&lt;sub&gt;r&lt;/sub&gt;&lt;/span&gt;+ &amp;omega; X V&lt;sub&gt;r&lt;/sub&gt;+ &lt;span style="color: #ff0000;"&gt;&amp;#945;&lt;/span&gt; X r + &amp;omega; X (dr/dt)&lt;sub&gt;f&lt;/sub&gt;&amp;nbsp;&amp;nbsp; (Eqn. 11)&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;and one last substitution using the transport theorem for the right most term in Eqn. 11 to get&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A&lt;sub&gt;r&amp;#8217;&lt;/sub&gt; =&amp;nbsp; A+ A&lt;sub&gt;r&lt;/sub&gt;+ &amp;omega; X V&lt;sub&gt;r&lt;/sub&gt;+ &amp;#945; X r + &amp;omega; X &lt;span style="color: #ff0000;"&gt;((dr/dt)&lt;sub&gt;r&lt;/sub&gt; + &amp;omega; X r)&lt;/span&gt;&amp;nbsp; (Eqn. 12)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A&lt;sub&gt;r&amp;#8217;&lt;/sub&gt; =&amp;nbsp; A+ A&lt;sub&gt;r&lt;/sub&gt;+ &amp;omega; X V&lt;sub&gt;r&lt;/sub&gt;+ &amp;#945; X r + &amp;omega; X (&lt;span style="color: #ff0000;"&gt;V&lt;sub&gt;r&lt;/sub&gt;&lt;/span&gt; + &amp;omega; X r)&amp;nbsp; (Eqn. 13)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A&lt;sub&gt;r&amp;#8217;&lt;/sub&gt; =&amp;nbsp; A+ A&lt;sub&gt;r&lt;/sub&gt;+ &amp;omega; X V&lt;sub&gt;r&lt;/sub&gt;+ &amp;#945; X r + &lt;span style="color: #ff0000;"&gt;&amp;omega; X V&lt;sub&gt;r&lt;/sub&gt; + &amp;omega; X (&amp;omega; X r)&lt;/span&gt;)&amp;nbsp; (Eqn. 14)&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="0" cellpadding="2" cellspacing="2" class="aligncenter"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt;A&lt;sub&gt;r'&lt;/sub&gt; =&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;A + A&lt;sub&gt;r&lt;/sub&gt; + &lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;&amp;lt;-- Inertial Acceleration&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:0px solid black;"&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;2&amp;omega; X V&lt;sub&gt;r&lt;/sub&gt; +&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;&amp;lt;-- Coriolis Acceleration&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;&amp;#945; X r +&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;&amp;lt;-- Euler Acceleration&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;&amp;omega; X (&amp;omega; X r))&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;text-align: left;"&gt;&lt;strong&gt;&amp;lt;-- Centripetal Acceleration&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;(Eqn. 15)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;Eqn. 15 is a classic result, and can give you a lot of insight into tradeoffs associated with accelerometer placement.&amp;nbsp; To see how, let's modify our previous figure by locating O&lt;sub&gt;r&lt;/sub&gt; at the center of mass of a portable consumer device.&amp;nbsp; Point P represents the location of our accelerometer within the same device.&amp;nbsp; Point O&lt;sub&gt;f&lt;/sub&gt; is essentially the center of the earth.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1484-1216/for2.jpg"&gt;&lt;img alt="for2.jpg" class="jive-image" height="389" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1484-1216/406-389/for2.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="406"/&gt;&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;em&gt;Frames of Reference related to Portable Consumer Device&lt;/em&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Since points P and O&lt;/span&gt;&lt;sub&gt;r&lt;/sub&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;are fixed relative to one another (they are part of the same rigid body), A&lt;/span&gt;&lt;sub&gt;r&lt;/sub&gt;&lt;span&gt; and V&lt;/span&gt;&lt;sub&gt;r&lt;/sub&gt;&lt;span&gt;&amp;nbsp; are zero by definition, and drop out of the equation.&amp;nbsp; If the rotational rate of the device is zero, then &amp;omega;=0, and both Coriolis and Centripetal acceleration terms drop out of the equation.&amp;nbsp; Finally,&amp;nbsp; if &amp;#945; (the rotational acceleration) is zero, there will be no Euler acceleration.&amp;nbsp; If all these terms hold true, then the value measured by our accelerometer is&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&amp;nbsp; A&lt;sub&gt;r&amp;#8217;&lt;/sub&gt; =&amp;nbsp; A = the translational rate between the two frames of reference&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;which is exactly what we would like.&amp;nbsp; But what if &amp;omega;&amp;#8800;0?&amp;nbsp; If we collapse point P back into the center of mass (O&lt;/span&gt;&lt;sub&gt;r&lt;/sub&gt;&lt;span&gt;), then both Euler and Centripetal accelerations still drop out.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;What happens if you ignore these effects?&amp;nbsp; Let's work an example assuming that angular acceleration is zero, but angular rotation is not:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="0" cellpadding="2" cellspacing="2" class="aligncenter"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt;A&lt;sub&gt;r'&lt;/sub&gt; =&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt;A + A&lt;sub&gt;r&lt;/sub&gt; + &lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt;&amp;lt;-- Inertial Acceleration&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt;&amp;omega; X (&amp;omega; X r))&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;&lt;strong&gt;&amp;lt;-- Centripetal Acceleration&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:0px solid black;"&gt;(Eqn. 16)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;To bound the problem, I'm going to take advantage of the identity:&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;A X B = |A| |B| sin &amp;#920; &lt;strong&gt;n&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;where &amp;#920; is the angle between vectors A and B, and&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;n&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;is a unit vector perpendicular to the plane containing both A and B.&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span&gt;Looking at just the extremes, we can see that the Centripetal acceleration ranges between +/- |&amp;omega;|&lt;/span&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;span&gt;r in magnitude, depending upon the axis of rotation and accelerometer offset from center of mass.&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span&gt;Assume&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="list-style: none;"&gt;&lt;/li&gt;&lt;li&gt;&amp;omega; = 2&amp;#960; radians/sec&lt;/li&gt;&lt;li style="list-style: none;"&gt;&lt;/li&gt;&lt;li&gt;r = 5 cm&lt;/li&gt;&lt;li style="list-style: none;"&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;Putting numbers to Eqn. 16, we get&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;Centripetal Acceleration = +/- 0.05 (2&amp;#960;)&lt;sup&gt;2&lt;/sup&gt; =+/- 1.97 m/s&lt;sup&gt;2&lt;/sup&gt;.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;That's better than 1/5 gravities!&amp;nbsp;&amp;nbsp; At a very modest rate of rotation!&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Basically, sensor fusion mathematics get much easier when the accelerometer is at the center of mass (which is also the center of the rotating frame of reference).&amp;nbsp; If you can make the assumption that, in your use case, the device is in a quasi-static state with no rotation, it doesn't matter.&amp;nbsp; If not, you need to place the sensor at the center of mass OR account for the effects mathematically.&amp;nbsp; That involves keeping continuous track of the axis and rate of rotation and then making the adjustments required to separate out the Centripetal acceleration.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Dynamics of Particles and Rigid Bodies: A Systematic Approach, Anil V. Rao, Cambridge University Press, 2006&lt;/li&gt;&lt;li&gt;Motion in a Non-Inertial Frame, Alain J. Brizard, Saint Michael's College, &lt;a class="jive-link-external-small" href="http://www.dartmouth.edu/~phys44/lectures/Chap_6.pdf"&gt;http://www.dartmouth.edu/~phys44/lectures/Chap_6.pdf&lt;/a&gt;&lt;/li&gt;&lt;li style="list-style: none;"&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:b606f669-53bc-4232-b756-2eedb7c144b6] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/amdrN7qjVPo" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">accelerometer</category>
      <category domain="/community/the-embedded-beat/tags">sensor</category>
      <category domain="/community/the-embedded-beat/tags">xtrinsic</category>
      <category domain="/community/the-embedded-beat/tags">sensors</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">mems</category>
      <pubDate>Thu, 02 Aug 2012 03:28:48 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/08/01/accelerometer-placement--where-and-why</guid>
      <dc:date>2012-08-02T03:28:48Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/08/01/accelerometer-placement--where-and-why</feedburner:origLink></item>
    <item>
      <title>The Freedom Board</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/GjzaCrs8dCU/the-freedom-board</link>
      <description>&lt;!-- [DocumentBodyStart:8af24695-04e0-458b-be8f-ea0926eaddec] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;By Erich Styger&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;There are some advantages to working for a high tech company like Freescale. One of them is early access to cool toys. Yesterday was my &amp;lsquo;lucky day&amp;#8217;: my &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.element14.com/community/docs/DOC-46626/l/element14-exclusive-kinetis-l-based-freescale-freedom-development-board"&gt;Freescale Kinetis L series Freedom board&lt;/a&gt;&lt;span&gt; arrived.&amp;nbsp; This board is really nice and features the KL25Z from the &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=KINETIS_L_SERIES"&gt;recently announced Kinetis L series&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;microcontrollers. The microcontroller on this board is an&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.arm.com/products/processors/cortex-m/cortex-m0plus.php"&gt;ARM Cortex M0+ processor,&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;which we demonstrated at the Freescale Technology Forum. You can see a&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.youtube.com/watch?v=FfsMCwUjNxw"&gt;really neat video here&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;that shows off the energy efficiency and how the Kinetis L series outperforms the competition in the video. It&amp;#8217;s not an accident. If you&amp;#8217;d like to know why, there&amp;#8217;s a system engineering&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.youtube.com/watch?v=Ef4mI17FCQc&amp;amp;feature=related"&gt;deep dive here&lt;/a&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Before we get started, there are two other really important things you will want to know when this article is done, so I&amp;#8217;ll answer the questions right up front:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;where do I get one&lt;/strong&gt;&lt;span&gt;, and&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;how much does it cost&lt;/strong&gt;&lt;span&gt;?&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The board will be available at Element 14/Farnell. It is expected to be publicly available by the end of September 2012, and you can pre-order now. The&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.element14.com/community/docs/DOC-46626/l/element14-exclusive-kinetis-l-based-freescale-freedom-development-board"&gt;United States Element 14 site&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;will have the board available for a suggested resale price of $12.95 (USD). In Europe it will be about 10 Euro. You read those prices correctly.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;All right. Without further delay, let&amp;#8217;s start talking about this board, and about getting some software to run on it.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;What is the first thing I want to flash on this processor? Yep: some FreeRTOS tasks. I want an operating system. We will have a reduced version of MQX as well, called MQX Lite. Look for information on that in the coming days. I have worked extensively with FreeRTOS, and I want that on this new board as well. To get there, a few important things have to be sorted out:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Get the board up and running&lt;/li&gt;&lt;li&gt;Get Eclipse-based build tools for the ARM Cortex-M0+ processor&lt;/li&gt;&lt;li&gt;Extend the Processor Expert FreeRTOS component to work with GCC and the Cortex-M0+ processor&lt;/li&gt;&lt;li&gt;Test, Debug and Celebrate&lt;/li&gt;&lt;/ol&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Freedom Board&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The board, shown in Figure 1, has a nice and small form factor of 81 mm x 54 mm, which makes it ideal for a lot of applications.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1485-1217/figure-1-the-freedom-board.png"&gt;&lt;img alt="figure-1-the-freedom-board.png" class="jive-image" height="388" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1485-1217/642-388/figure-1-the-freedom-board.png" style="display: block; margin-left: auto; margin-right: auto;" width="642"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 1. The Freedom Board.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;You can see it has headers along either side. Those allow me to plug in other boards. The board is intended to be compatible with&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.arduino.cc/"&gt;Arduino&lt;/a&gt;&lt;span&gt; shields. What shields are in fact compatible is not clear yet, but the connector is able to provide 5V, while using 3.3V signals.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Figure 2 is the block diagram for the board. There is a touch sensor along one side. Note also the presence of the Freescale&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=K20_USB_MCU"&gt;K20&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;microcontroller wired directly to one of the USB ports. It is the center of the debug interface.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1485-1218/figure-2-freedom-board-block-diagram.png"&gt;&lt;img alt="figure-2-freedom-board-block-diagram.png" class="jive-image" height="459" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1485-1218/623-459/figure-2-freedom-board-block-diagram.png" style="display: block; margin-left: auto; margin-right: auto;" width="623"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 2. Freedom Board Block Diagram.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;There are two mini USB connectors on the board: one is the target USB connector (the KL25Z implements USB), the other is the on-board debug connector. Yes, like the Tower board, the Freedom board has on-board debug solution on it. Connecting the board using the debug connector automatically installs the drivers.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The debug connection features a bootloader similar to the &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.steinerberg.com/EmbeddedComponents/BootLoaderUSB"&gt;Processor Expert USB Bootloader&lt;/a&gt;&lt;span&gt; component. Using this, it is possible to program new firmware/software by simply dragging a file. This is really nice, and I am looking forward to exploring this more in the future. In principle, you can use this to&amp;#8212;very easily&amp;#8212;reprogram the internal workings of the Kinetis K20 to make the debug interface look like almost anything you want.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;GCC and an Eclipse IDE&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;So, I have this inexpensive and highly capable hardware. This is a new chip architecture. What tool chain can I use for Cortex-M0+ processor? The good news is that there is a&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="https://launchpad.net/gcc-arm-embedded"&gt;GCC tool chain maintained by ARM&lt;/a&gt;&lt;span&gt; available both for Cortex-M0+ and Cortex-M4 processors. Additionally, there are &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://sourceforge.net/projects/gnuarmeclipse/"&gt;ARM GCC Eclipse &lt;/a&gt;&lt;span&gt;panels available too. With this, it is not too hard to have a working Eclipse environment. Freescale has implemented this inside the CodeWarrior IDE, and you&amp;#8217;ll see it in CodeWarrior for MCU 10.3. The final version of CodeWarrior may differ slightly from the screenshot you see in Figure 3, but for sure you will see the ARM GCC compiler for the Cortex-M0+ processor.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1485-1219/figure-3-arm-gcc-panels.png"&gt;&lt;img alt="figure-3-arm-gcc-panels.png" class="jive-image" height="599" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1485-1219/654-599/figure-3-arm-gcc-panels.png" width="654"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 3. ARM GCC Panels.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;FreeRTOS&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Processor Expert Component&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;My next task was to extend my Processor Expert component to work with GCC. This mainly means it must work with the GCC assembly syntax. To do this I must extend&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;&lt;em&gt;port.c&lt;/em&gt;&lt;/strong&gt;&lt;span&gt;of the FreeRTOS distribution.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I already had a FreeRTOS port for CodeWarrior and Kinetis K-Family. I modified that code to work with both a Cortex-M4 and a Cortex-M0+ processor. Below is an extract of the code that deals with both MCU types.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[sourcecode language="cpp"]&lt;/span&gt;&lt;br/&gt;&lt;span&gt;__attribute__ ((naked)) void vPortSVCHandler(void) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt;#if FREERTOS_CPU_CORTEX_M==4 /* Cortex M4 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;__asm volatile (&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldr r3, pxCurrentTCBConst2 \n" /* Restore the context. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldr r1, [r3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* Use pxCurrentTCBConst to get the pxCurrentTCB address. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldr r0, [r1]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* The first item in pxCurrentTCB is the task top of stack. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;/* pop the core registers */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldmia r0!, {r4-r11}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" msr psp, r0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" mov r0, #0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" msr basepri, r0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" orr r14, r14, #13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" bx r14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" .align 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;"pxCurrentTCBConst2: .word pxCurrentTCB \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;#else /* Cortex M0+ */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;__asm volatile (&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldr r3, pxCurrentTCBConst2 \n" /* Restore the context. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldr r1, [r3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* Use pxCurrentTCBConst to get the pxCurrentTCB address. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldr r0, [r1]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* The first item in pxCurrentTCB is the task top of stack. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" add r0, r0, #16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* Move to the high registers. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldmia r0!, {r4-r7}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* Pop the high registers. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" mov r8, r4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" mov r9, r5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" mov r10, r6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" mov r11, r7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" msr psp, r0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* Remember the new top of stack for the task. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" sub r0, r0, #32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* Go back for the low registers that are not automatically restored. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" ldmia r0!, {r4-r7}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* Pop low registers.&amp;nbsp; */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" mov r1, r14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n" /* OR R14 with 0x0d. */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" movs r0, #0x0d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" orr r1, r0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;" bx r1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;".align 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;"pxCurrentTCBConst2: .word pxCurrentTCB \n"&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;#endif&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;My First Freedom Application&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;After a few iterations, my FreeRTOS Processor Expert component worked with all the previous cores and compilers, plus with GCC for Cortex-M4 and Cortex-M0+ processors.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;The Freedom board has an RGB LED, so my first application was to run three tasks, each toggling one color of the LED. For this I added three Processor Expert LED components to my project, as shown in Figure 4.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1485-1220/figure-4-freedom-board-processor-expert-components.png"&gt;&lt;img alt="figure-4-freedom-board-processor-expert-components.png" class="jive-image" height="255" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1485-1220/210-255/figure-4-freedom-board-processor-expert-components.png" style="display: block; margin-left: auto; margin-right: auto;" width="210"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 4. Freedom Board Processor Expert Components.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Here is the complete source code of the demo application where&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;APP_Run()&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;is called from&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;main()&lt;/code&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[sourcecode language="cpp"]/*&lt;/span&gt;&lt;br/&gt;&lt;span&gt;/* Application.c&lt;/span&gt;&lt;br/&gt;&lt;span&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: Erich Styger&lt;/span&gt;&lt;br/&gt;&lt;span&gt;*/&lt;/span&gt;&lt;br/&gt;&lt;span&gt;#include "Application.h"&lt;/span&gt;&lt;br/&gt;&lt;span&gt;#include "LED1.h"&lt;/span&gt;&lt;br/&gt;&lt;span&gt;#include "LED2.h"&lt;/span&gt;&lt;br/&gt;&lt;span&gt;#include "LED3.h"&lt;/span&gt;&lt;br/&gt;&lt;span&gt;#include "FRTOS1.h"&lt;/span&gt;&lt;br/&gt;&lt;span&gt;#include "WAIT1.h"&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;static portTASK_FUNCTION(Task1, pvParameters) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(void)pvParameters; /* parameter not used */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for(;;) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LED1_Neg();&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;FRTOS1_vTaskDelay(1000/portTICK_RATE_MS);&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;static portTASK_FUNCTION(Task2, pvParameters) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(void)pvParameters; /* parameter not used */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for(;;) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LED2_Neg();&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;FRTOS1_vTaskDelay(1050/portTICK_RATE_MS);&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;static portTASK_FUNCTION(Task3, pvParameters) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(void)pvParameters; /* parameter not used */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for(;;) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LED3_Neg();&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;FRTOS1_vTaskDelay(2080/portTICK_RATE_MS);&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;void APP_Run(void) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uint16_t i;&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for(i=0;i&amp;lt;4;i++) {&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LED1_Neg();&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LED2_Neg();&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LED3_Neg();&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;WAIT1_Waitms(250);&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;if (FRTOS1_xTaskCreate(&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Task1,&amp;nbsp; /* pointer to the task */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(signed portCHAR *)"Task1", /* task name for kernel awareness debugging */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;configMINIMAL_STACK_SIZE, /* task stack size */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(void*)NULL, /* optional task startup argument */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tskIDLE_PRIORITY,&amp;nbsp; /* initial priority */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(xTaskHandle*)NULL /* optional task handle to create */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;) != pdPASS)&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;/*lint -e527 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for(;;){}; /* error! probably out of memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;/*lint +e527 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;if (FRTOS1_xTaskCreate(&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Task2,&amp;nbsp; /* pointer to the task */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(signed portCHAR *)"Task2", /* task name for kernel awareness debugging */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;configMINIMAL_STACK_SIZE, /* task stack size */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(void*)NULL, /* optional task startup argument */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tskIDLE_PRIORITY,&amp;nbsp; /* initial priority */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(xTaskHandle*)NULL /* optional task handle to create */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;) != pdPASS)&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;/*lint -e527 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for(;;){}; /* error! probably out of memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;/*lint +e527 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;if (FRTOS1_xTaskCreate(&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Task3,&amp;nbsp; /* pointer to the task */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(signed portCHAR *)"Task3", /* task name for kernel awareness debugging */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;configMINIMAL_STACK_SIZE, /* task stack size */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(void*)NULL, /* optional task startup argument */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tskIDLE_PRIORITY,&amp;nbsp; /* initial priority */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(xTaskHandle*)NULL /* optional task handle to create */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;) != pdPASS)&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;/*lint -e527 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for(;;){}; /* error! probably out of memory */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;/*lint +e527 */&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;FRTOS1_vTaskStartScheduler();&lt;/span&gt;&lt;br/&gt;&lt;span&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span&gt;[/sourcecode]&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This creates a nice colorful changing ambient light, and that light is bright! Not bad for a day&amp;#8217;s work (Figure 5).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1485-1221/figure-5-freedom-rgb-led-controlled-by-three-freertos-tasks.png"&gt;&lt;img alt="figure-5-freedom-rgb-led-controlled-by-three-freertos-tasks.png" class="jive-image" height="329" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1485-1221/500-329/figure-5-freedom-rgb-led-controlled-by-three-freertos-tasks.png" width="500"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 5.&amp;nbsp; Freedom RGB LED controlled by three FreeRTOS tasks.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;The updated Processor Expert component for FreeRTOS with added GCC and Cortex-M0+ support is available &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.steinerberg.com/EmbeddedComponents/FreeRTOS"&gt;here&lt;/a&gt;&lt;span&gt;. You can&amp;#8217;t get the Freedom board yet, because you can&amp;#8217;t get the Kinetis L series processors yet. The Processor Expert component is available now.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;So, the Freedom board is a package that:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Provides access to the Cortex-M0+ core with industry-leading energy efficiency&lt;/li&gt;&lt;li&gt;Costs not much more than the change you carry in your pocket&lt;/li&gt;&lt;li&gt;Has a programmable debug connection&lt;/li&gt;&lt;li&gt;Is supported by GCC-based build tools&lt;/li&gt;&lt;li&gt;Has Processor Expert component support for two RTOS&amp;#8217;s (FreeRTOS and MQX Lite)&lt;/li&gt;&lt;li&gt;Has Arduino shield compatibility&lt;/li&gt;&lt;li&gt;Has an RGB LED that will ruin your night vision&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Stay tuned for more on the Kinetis L series, the Freedom board, CodeWarrior 10.3, assorted other tools for the Kinetis L series, Processor Expert Software, and MQX Lite. There is a lot coming!&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Happy Freedom!&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:8af24695-04e0-458b-be8f-ea0926eaddec] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/GjzaCrs8dCU" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">arm</category>
      <category domain="/community/the-embedded-beat/tags">kinetis</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">processor-expert</category>
      <category domain="/community/the-embedded-beat/tags">arm-cortex-m0+</category>
      <category domain="/community/the-embedded-beat/tags">azrm-cortext</category>
      <category domain="/community/the-embedded-beat/tags">freedom-board</category>
      <category domain="/community/the-embedded-beat/tags">kinetis-l-series</category>
      <pubDate>Sat, 28 Jul 2012 03:06:37 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/07/27/the-freedom-board</guid>
      <dc:date>2012-07-28T03:06:37Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/07/27/the-freedom-board</feedburner:origLink></item>
    <item>
      <title>CodeWarrior Tool Tip #9: Stop on startup</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/De2B_bZYHZg/codewarrior-tool-tip-9-stop-on-startup</link>
      <description>&lt;!-- [DocumentBodyStart:ec58dfe0-8657-45db-a2ea-382a09cee3d9] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;By Erich Styger -- &lt;/strong&gt;&lt;span&gt;Occasionally I run into a particularly unpleasant problem: from the CodeWarrior IDE, I have downloaded my application onto my target board for debugging, and the debugger immediately loses the connection (Figure 1).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1483-1222/figure-1-a-problem-occured.jpg"&gt;&lt;img alt="figure-1-a-problem-occured.jpg" class="jive-image" height="284" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1483-1222/378-284/figure-1-a-problem-occured.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="378"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 1. What happened here?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;What is the problem? To answer that, it is helpful to understand what occurs when the CodeWarrior IDE (or any other debugger tool) starts a debugger session.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What Happens on Debug&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Clicking on the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Debug&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;button in the CodeWarrior IDE sets into motion a sequence of events that configures the probe connection to the target board, downloads the program into the firmware (either on-chip or on the board) and readies the debug session. More specifically:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;The CodeWarrior IDE flashes the application onto the target board. (For this to occur successfully, either the debugger or the probe &amp;#8211; for example, the P&amp;amp;E Multilink probe &amp;#8211; downloads a small applet into the target RAM that performs the actual flash programming. The flash programming applet starts. The debugger then feeds data &amp;#8211; the program code &amp;#8211; to the applet until all of it is transferred into flash.)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;The debugger initializes the processor's PC (Program Counter) and SP (Stack Pointer).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;If configured to do so, the debugger sets a temporary breakpoint. More on this in a moment.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;The debugger issues a &amp;#8220;run&amp;rdquo; command. That is, the debugger tells the processor to begin execution, starting from the address that was stored in the PC.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;What exactly happens in step two (setting the initial PC address) depends a bit on the microcontroller architecture. Furthermore, it seems every debugger handles the initialization a bit differently, too. Despite the differences, the usual outcome is that the PC and the SP are set up. These values are usually stored somewhere in the vector table (for example, for S08 and ColdFire microcontrollers). These values are also fetched by the processor when it is reset. Often what the debugger does is simply assert a reset to reload these values.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Temporary Breakpoint&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The interesting part is step three, where the debugger sets a&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;temporary breakpoint&lt;/em&gt;&lt;span&gt;. A temporary breakpoint only happens once, and is then removed. Usually this breakpoint is set at&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;main()&lt;/code&gt;&lt;span&gt;. This way when you start a debug session, the debugger lets all of the startup code execute and the program halts at&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;main()&lt;/code&gt;&lt;span&gt;. This arrangement spares you from stepping through numerous lines of startup code that configure the processor registers and initialize the peripherals. This makes sense because what you really want to do is dive right into the application code.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This plan works fine, unless the train of execution jumps the track somewhere between the reset address and&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;main()&lt;/code&gt;&lt;span&gt;, and you get the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Problem Occurred&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;dialog in Figure 1. Typical things that could go wrong are:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The startup code takes too long to execute. This results in a watchdog timer expiring. The watchdog dutifully resets the target before your code in &lt;code&gt;main()&lt;/code&gt; gets a chance to 'feed the dog' (reset the timer). A typical culprit here is where the startup code has to initialize, or zero, large amounts of memory.&lt;/li&gt;&lt;li&gt;The application entry point or initial stack pointer is incorrect, causing a bus access error.&lt;/li&gt;&lt;li&gt;The run control/debug connection gets severed when the target crashes.&lt;/li&gt;&lt;li&gt;Any other weird problem you could imagine and probably quite a few that you can't.&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;strong&gt;Stop on Startup&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;To solve this problem, you need to look at the startup code. That is, you want to tell the debugger to stop earlier than in&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;main()&lt;/code&gt;&lt;span&gt;, so that you can examine the operation of the startup code. Fortunately, there is a setting for this in the debug/run launch configuration window (Figure 2):&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1483-1223/figure-2-stop-on-startup-setting-in-debugger-options-of-a-launch-configuration.png"&gt;&lt;img alt="figure-2-stop-on-startup-setting-in-debugger-options-of-a-launch-configuration.png" class="jive-image" height="214" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1483-1223/361-214/figure-2-stop-on-startup-setting-in-debugger-options-of-a-launch-configuration.png" style="display: block; margin-left: auto; margin-right: auto;" width="361"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 2. The &amp;#8220;Stop on startup at&amp;rdquo; setting in the Debugger options.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;If the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Stop on startup at&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;setting is checked, the debugger sets a temporary breakpoint as determined by the next two options. Otherwise, the target runs. The choices are:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Program entry point:&lt;/strong&gt; If selected, the debugger places a breakpoint at the beginning of the program code (which includes the startup code).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;User specified:&lt;/strong&gt; If selected, here you can specify the name of any function. The debugger then places a breakpoint at the start of the specified function. As the figure shows, the default function name is &lt;code&gt;main()&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Program Entry Point&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;One question remains: where is this program entry point? You would like to have some idea where the debugger will take control, if only to reassure you that the problem is not in the probe.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The HCS08 linker reports it in the linker map file, like so:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;**********************************************************************&lt;br/&gt;STARTUP SECTION&lt;br/&gt;----------------------------------------------------------------------&lt;br/&gt;Entry point: 0xC004 (_EntryPoint)&lt;br/&gt;_startupData is allocated at 0xC09C and uses 6 Bytes&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;The S08 linker has the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;ENTRY&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;command, which assigns the address of the program entry point to the linker. The entry point is encoded in the application ELF file format. However it can be displayed with an ELF/Dwarf reader such as&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;readelf&lt;/code&gt;&lt;span&gt;. For a CoreWarrior for MCUs tool installation, run&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;{MCU10.2 Installation}\Cross_Tools\CodeSourcery_Linux\bin\m68k-linux-gnu-readelf.exe&lt;/code&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The output of the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;readelf&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;should appear as:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;readelf -l hello.abs&lt;br/&gt;Elf file is EXEC (Executable file)&lt;br/&gt;Entry point 0xc004&lt;br/&gt;....&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Therefore, the debugger should halt the program at address 0xc004 when you click&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Debug&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If the debug session goes weird right after download, or if the application does not reach&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;main&lt;/code&gt;&lt;span&gt;(), then stop the debugger at the program entry point, rather than at&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;main()&lt;/code&gt;&lt;span&gt;. It&amp;#8217;s easy to do.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Happy Stopping!&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:ec58dfe0-8657-45db-a2ea-382a09cee3d9] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/De2B_bZYHZg" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">codewarrior</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">codewarrior-debugger</category>
      <category domain="/community/the-embedded-beat/tags">codewarrior-tool-tip</category>
      <category domain="/community/the-embedded-beat/tags">debugger</category>
      <category domain="/community/the-embedded-beat/tags">breakpoints</category>
      <category domain="/community/the-embedded-beat/tags">startup-code</category>
      <pubDate>Mon, 16 Jul 2012 21:33:44 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/07/16/codewarrior-tool-tip-9-stop-on-startup</guid>
      <dc:date>2012-07-16T21:33:44Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/07/16/codewarrior-tool-tip-9-stop-on-startup</feedburner:origLink></item>
    <item>
      <title>Let's get real: Vybrid asymmetric multicore processors start sampling</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/uN0PkXYRwoI/lets-get-real-vybrid-asymmetric-multicore-processors-start-sampling</link>
      <description>&lt;!-- [DocumentBodyStart:64468907-a150-436a-a4a8-4a6463e716da] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;By Tom Thompson&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;-- Not long ago, Jim Trudeau wrote a&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1448" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2012/03/27/vybrid-controllers-asymmetric-multicore-processing-is-not-just-for-breakfast-any-more"&gt;blog article&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;about our forthcoming Vybrid controller units.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;To briefly recap, a Vybrid controller is a system-on-a-chip (SoC) that is capable of handling both network connections and a user interface, yet also respond in real-time to events generated by sensors or other means. At the time, there wasn't any silicon available. However, simulator tools allowed select customers to begin developing software. It was expected that Vybrid controller parts would begin limited sampling around mid-year.&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Mid-year has come, and so it's worth revisiting the Vybrid controller scene for a more in-depth look at the software and silicon. Let's start with the silicon.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Die with a Split Personality&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Vybrid controllers come in assorted product families, ranging from microcontroller units (MCUs) that target cost-sensitive, low-power designs up to multicore microprocessor units (MPUs) that address high-performance, highly-responsive rich media products. An overview of the various Vybrid controller parts and the markets they target is available&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/homepage.jsp?nodeId=018rH3E3E0"&gt;here&lt;/a&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;A comprehensive discussion of the complete Vybrid controller product line is not possible in this article, so I'll focus on the high-end Vybrid controller VF7xx part. First, it can handle two independent TFT LCD displays, along with touch screen support. Second, it also manages high-speed Ethernet connections with IEEE 1588 time stamping, and has the ability to process audio and video input streams in real-time. The Vybrid controller VF7xx can deal with both compute-intensive interfaces and real-time processing because it has a split personality: two independent heterogeneous cores, an ARM Cortex-A5 and an ARM Cortex-M4, are integrated onto the die. See Figure 1.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1479-1224/vf7xx_bdv21.jpg"&gt;&lt;img alt="vf7xx_bdv21.jpg" class="jive-image" height="361" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1479-1224/595-361/vf7xx_bdv21.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="595"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 1 The VF7xx has two disparate cores that manage a huge array of peripherals.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;The ARM Cortex-A5 core supports IEEE 754-compliant double-precision floating-point arithmetic, has a NEON graphics acceleration engine with SIMD instruction support, security mechanisms, plus L1 and L2 caches. It does the heavy lifting for compute-intensive operations such as processing audio and video media streams.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The ARM Cortex-M4 has DSP instructions that implement 32-bit MAC operations, and support for IEEE 754-compliant single-precision floating-point arithmetic. It has 16 KB instruction and data caches to boost throughput. These capabilities enable this core to execute low-latency yet computationally demanding operations, making it ideal for real-time work.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;In terms of I/O interfaces, the Vybrid controller7xx is, to use the vernacular of my youth, loaded for bear. It has:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;10/100 Ethernet controller&lt;/li&gt;&lt;li&gt;Dual USB 2.0 controllers with integrated PHY&lt;/li&gt;&lt;li&gt;Two CAN modules&lt;/li&gt;&lt;li&gt;Four DSPI interfaces&lt;/li&gt;&lt;li&gt;Four I2C interfaces&lt;/li&gt;&lt;li&gt;Video interface unit with camera support for 8- and 10-bit ITU656 video&lt;/li&gt;&lt;li&gt;Four synchronous audio interfaces&lt;/li&gt;&lt;li&gt;Asynchronous audio sample converter with several rate conversions&lt;/li&gt;&lt;li&gt;Sony Philips Digital interface for digital audio I/O&lt;/li&gt;&lt;li&gt;Dual TFT LCD display interface with XGA (1024 by 768 pixels) resolution&lt;/li&gt;&lt;li&gt;Four-wire resistive touch screen controller&lt;/li&gt;&lt;li&gt;Xtrinsic touch screen interface that supports both resistive and capacitive screens&lt;/li&gt;&lt;li&gt;Two 12-bit ADCs&lt;/li&gt;&lt;li&gt;Two 12-bit DACs&lt;/li&gt;&lt;li&gt;Assorted timers&lt;/li&gt;&lt;li&gt;Memory controller for DDR3 and LPDDR2 memories, with EEC support&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;To handle the speeds and feeds of all these peripherals, 64 DMA channels enable low-overhead transfers between the peripherals and memory. In addition, a crossbar switch enables concurrent multi-master bus accesses between peripherals, memory, and the cores. Address space controllers provide memory protection for all of the crossbar switch masters, which reduce the chance of data corruption.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Given the vast array of on-chip peripherals, all sorts of intriguing product designs based on a minimum of parts are possible.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The Software Scene&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The silicon solution, as promising as it sounds, isn't very useful if it lacks the necessary software. Since Freescale's goal is to make the design of both the hardware and software in a product easier, we have software in place to support the Vybrid family.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;In terms of operating systems, there is our own MQX RTOS, which I have written about&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1279" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2011/04/20/writing-real-solutions-for-real-time-using-mqx"&gt;here&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;. We also offer a board support package (BSP) that features a comprehensive native Linux implementation for the part. There are libraries for math, encryption, and motor control. Complimentary boot loaders that function over a variety of interfaces such as USB, Ethernet, RF, and serial connections are provided. To handle video and audio operations, a media framework is available, and a complimentary Freescale&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=EGUI&amp;amp;fsrch=1&amp;amp;sr=4"&gt;embedded GUI (eGUI)&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;software driver provides support for graphics LCD panels. This software can be downloaded from the Freescale web site.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Vybrid controller solutions use the Freescale&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/homepage.jsp?code=TOWER_HOME&amp;amp;fsrch=1&amp;amp;sr=11"&gt;Tower System&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;platform for software development.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Figure 2 shows a common software scenario using the VF7xx part. Here, the ARM Cortex-A5 core executes the Linux kernel to manage network connections and the human machine interface (HMI). The ARM Cortex-M4 core executes the MQX RTOS and deals with the real-time interrupts and some data processing. A low-latency interprocessor communications API developed in-house by Freescale supervises the communications and the integrity of any data shared between the two cores. Note that the example shown in the figure is not a required software configuration. The Vybrid controller could execute two copies of MQX (MQX RTOS for the Cortex-A5 is in development), or a Linux kernel along with a lightweight task scheduler, or just bare-board code. It all depends upon the demands of your product design.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1479-1225/vybrid_follow-up_fig22.jpg"&gt;&lt;img alt="vybrid_follow-up_fig22.jpg" class="jive-image" height="406" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1479-1225/606-406/vybrid_follow-up_fig22.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="606"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 2 A Vybrid controller executing two different operating systems simultaneously.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;For a more tangible demo application, check out this video of an&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.youtube.com/watch?v=5497F217N5A&amp;amp;feature=plcp"&gt;automotive instrument cluster&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;using the Vybrid automotive solution.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Since samples will be limited, your design team can develop software using a comprehensive simulator provided by&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://vworks.com/"&gt;VWorks&lt;/a&gt;&lt;span&gt;. Its&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://vworks.com/products-solutions#_vlab_products"&gt;VLAB&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;product is a software simulator module that emulates the Vyrid VF7xx controller and effectively implements a virtual platform of the part. The two disparate ARM cores are simulated in great detail, along with many of the on-chip peripherals. You can examine the contents of registers and memory, and observe the state of bus transactions and the data transferred.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;For peripheral devices, you can call up information on the various attributes in use (such as the background color being used by the LCD controller, or the transfer rate of a UART), and display the contents of the various device registers. Even better, the output of most simulated peripherals can be examined to ensure the proper operation of the application software. For example, you can establish a Telnet session to one of the many emulated serial ports to observe the serial I/O generated by prototype application code. Even better, VLAB not only simulates the operation of the Vybrid video controllers, it also presents two virtual LCD screens that display the operation of any UI code. This level of simulation is not only very cool but helps developers verify the graphic output without the need of a prototype system.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;VLAB also facilitates code debugging through the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.arm.com/products/tools/software-tools/ds-5/index.php"&gt;ARM Development Studio 5 (ARM DS-5)&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tools (Figure 3). You use the ARM DS-5 tools to write and build software, and then have its debugger connect to VLAB. The virtual platform allows you to set breakpoints that can trigger when an access to a specific register or signal change occurs. You can debug code on both ARM cores simultaneously. For example, you can have both cores execute code in lock-step to detect synchronization problems. VLAB can collect and record extensive trace information to track down intermittent bugs or to measure code performance. Sessions can be recorded and played back.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1479-1226/vybrid_follow-up_fig3.jpg"&gt;&lt;img alt="vybrid_follow-up_fig3.jpg" class="jive-image" height="556" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1479-1226/564-556/vybrid_follow-up_fig3.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="564"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 3 Using the ARM DS-5 tools to debug code on the simulated Cortex-M4 core.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;You can write and use scripts to change the values of registers of the virtual platform or step through the code that it executes. Scripts can also be written to drive VLAB's operation so that you can perform regression testing on application code. In summary, VWorks's VLAB allows you to thoroughly debug and test your Vybrid controller application code, without any silicon.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Like any new platform, let alone a multicore platform, there is always a lag between announcement and general market availability of silicon. Even when silicon is widely available, your software team may be well ahead of your hardware development team. A virtual model and the tools provided by Freescale and our partner, VWorks, will help you be productive, with or without hardware. That&amp;#8217;s part of what we call enablement around here.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:64468907-a150-436a-a4a8-4a6463e716da] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/uN0PkXYRwoI" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">arm</category>
      <category domain="/community/the-embedded-beat/tags">controller</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">multicore</category>
      <category domain="/community/the-embedded-beat/tags">vybrid</category>
      <category domain="/community/the-embedded-beat/tags">automotive-controller</category>
      <category domain="/community/the-embedded-beat/tags">heterogeneous-cores</category>
      <pubDate>Thu, 05 Jul 2012 21:24:32 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/07/05/lets-get-real-vybrid-asymmetric-multicore-processors-start-sampling</guid>
      <dc:date>2012-07-05T21:24:32Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/07/05/lets-get-real-vybrid-asymmetric-multicore-processors-start-sampling</feedburner:origLink></item>
    <item>
      <title>CodeWarrior Tool Tip #8: Extending the build system</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/0YqYMSvxv_o/codewarrior-tool-tip-8-extending-the-build-system</link>
      <description>&lt;!-- [DocumentBodyStart:1a99dad7-358f-45de-b209-4e0c502aa74c] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;By Tom Thompson -- &lt;/strong&gt;&lt;span&gt;At Freescale, we spend a considerable amount of effort trying to make the work that goes into a design easier for our customers. The flexibility that our software tools provide often enables you to devise ways to make the embedded software development process for your project easier, or faster, or more reliable. Or even all three.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;As an example of this, let's look at a feature in the CodeWarrior tools that allows you to "extend" its build system. Specifically, you can have certain operations execute before or after the CodeWarrior build process. You might do this to, say, have a set of source files pre-processed before the CodeWarrior Eclipse build system gets involved. Or, you might perform post-processing on the ELF file generated by the build system. For example, in the latter case an ELF file might be converted into a format that is suitable for a production firmware burner. Or, a post-processing operation might append a CRC value to the embedded operating system image file that a bootloader would use to validate the integrity of the download.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This pre- and post-processing feature is not new: It's actually an enhanced version of a capability already present in the Classic CodeWarrior IDE. See Figure 1. (As an aside, you can see that valuable features such as this one do get carried forward to the CodeWarrior Eclipse IDE. However, sometimes features prove difficult to migrate to Eclipse, which was the case with CodeWarrior subprojects. However,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://blogs.freescale.com/2012/03/20/codewarrior-tool-tip-5-the-return-of-the-subproject/"&gt;&lt;span style="color: #800080;"&gt;subproject support has returned&lt;/span&gt;&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;in the CodeWarrior V10.2 tools.) In the Classic IDE, the pre- and post-processing feature was found in the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Target Settings&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;panel. Note that this ability was limited to performing actions before or after the link step of the build process.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1478-1227/figure-1-pre-and-post-link-processing-support-in-the-codewarrior-classic-ide.jpg"&gt;&lt;img alt="figure-1-pre-and-post-link-processing-support-in-the-codewarrior-classic-ide.jpg" class="jive-image" height="419" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1478-1227/620-419/figure-1-pre-and-post-link-processing-support-in-the-codewarrior-classic-ide.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="620"/&gt;&lt;/a&gt;&lt;strong&gt;Figure 1 Pre- and post-link processing support in the CodeWarrior Classic IDE&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;br/&gt;&lt;span&gt;In the CodeWarrior v10 IDE, this build feature happens to be buried deep in a project's build configuration settings. To get to it, choose&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Project &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;and then click on the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Build Steps&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tab (Figure 2). The first thing you should notice is that the pre-processing operations are carried out prior to the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;entire&lt;/em&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;build; they are not limited to the link step.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1478-1228/figure-2-pre-and-post-processing-commands-for-the-build-is-specified-in-these-options.jpg"&gt;&lt;img alt="figure-2-pre-and-post-processing-commands-for-the-build-is-specified-in-these-options.jpg" class="jive-image" height="289" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1478-1228/631-289/figure-2-pre-and-post-processing-commands-for-the-build-is-specified-in-these-options.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="631"/&gt;&lt;/a&gt;&lt;br/&gt;&lt;strong&gt;Figure 2 Pre- and post-processing commands for the build is specified in these options&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;The other difference is that the pre- and post-build command options allow you to enter an actual command line, whereas the Classic IDE choice did some sleight-of-hand to execute a program or kick-start a batch file. With the command line in the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Build Steps&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;option, you can specify a program to run and provide it with any argument values it requires. Or, you can have a batch file run, which leads to all sorts of interesting automation possibilities. Often you're going to have to provide path names and other information to make a usable command line, but this gives you the flexibility to do what you need, rather than be hemmed in by limited choices. In addition, the Eclipse IDE provides convenient symbols and environment variables that make the command line set up much easier. More on that in a moment.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Suppose you're working on a project that performs regression testing. This requires that you regularly pull an embedded application's latest and greatest source and header files from a networked server into your project before commencing a build. Using a text editor, you add the following commands into a batch file, named&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;copy.bat&lt;/code&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;rem delete old source and header files in project&lt;br/&gt;del ..\Sources\*.c&lt;br/&gt;del ..\Project_Headers\*.h&lt;br/&gt;rem fetch latest source and header files&lt;br/&gt;copy Z:\Superproject\Sources\*.c ..\Sources\*.c&lt;br/&gt;copy Z:\Superproject\Headers\*.h ..\Project_Headers\*.h&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Then you drag&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;copy.bat&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;into the project folder of the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;CodeWarrior Projects&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view in Eclipse. Go to the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Processing Steps&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tab as described previously and enter the following command into the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Command&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;option of the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Pre-build steps&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;group:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;$(ProjDirPath)/copy.bat&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Then click&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Apply&lt;/strong&gt;&lt;span&gt;. Now when you do a build, the commands in&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;copy.bat&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;execute, dutifully deleting and copying files into the specified project directories before kicking off the build.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Note the use of the Eclipse variable&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;$(ProjDirPath)&lt;/code&gt;&lt;span&gt;, which represents the directory path to your project folder. Table 1 shows a number of Eclipse variables that specify the location of tool directories, the name of your generated binary file (termed an&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;artifact&lt;/em&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;in Eclipse parlance), and other useful information.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Table 1 A few of the symbols maintained by Eclipse for build operations&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;&lt;strong&gt;Symbol&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;&lt;strong&gt;${MCUToolsBaseDir}&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;Specifies the absolute path where are MCU tool folders are located&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;&lt;strong&gt;${ProjDirPath}&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;Provides the absolute path to the current project folder&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;&lt;strong&gt;${BuildArtifactName}&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;Name of the image file to be output by the build system&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;&lt;strong&gt;${HC08Tools}&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;Returns the absolute path to the HCS08 command-line tools&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;&lt;strong&gt;${ProjName}&lt;/strong&gt;&lt;/td&gt;&lt;td style="border:1px solid black;" valign="top" width="319"&gt;Name of the project, as was specified in the CodeWarrior New Project wizard&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;You can use these variables to make powerful and flexible one-line commands. A set of the symbols and variables that Eclipse supports can found under&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Project &amp;gt; Properties &amp;gt; C/C++ General &amp;gt; Paths and Symbols&lt;/strong&gt;&lt;span&gt;. Click on&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;and then&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;to display a complete set of build variables (Figure 3).&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1478-1229/figure-3-the-pre-defined-variables-and-symbols-that-eclipse-uses.jpg"&gt;&lt;img alt="figure-3-the-pre-defined-variables-and-symbols-that-eclipse-uses.jpg" class="jive-image" height="601" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1478-1229/343-601/figure-3-the-pre-defined-variables-and-symbols-that-eclipse-uses.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="343"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;strong&gt;Figure 3 The pre-defined variables and symbols that Eclipse uses&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Since pre-build operations can create dependencies (those files need to finish copying before you turn the compiler on them, for example), the Eclipse IDE automatically switches off its parallel build capability. If necessary you can re-enable the parallel build capability, but be certain that there are no side-effects involved when doing this.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Now let's consider a post-build operation. The embedded software that passed the regression tests needs to be burned into firmware on prototype devices. The firmware burner, however only understands Intel HEX image files. Fortunately for you, the CodeWarrior burner utility that generates Motorola S-records for firmware burners can also generate image files in the Intel HEX format. Assuming that you're working with the HCS08 tools, you edit the burner utility control file,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;burner.bbl&lt;/code&gt;&lt;span&gt;, to specify Intel HEX output. This control file uses the batch burner language (BBL) to specify output file characteristics such as the format, and if the image is to be split across firmware chips, for example. The&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;burner.bbl&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;file is located in the project directory's&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;\Project_Settings\Liker_Files&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;folder. To start, make a copy of this file and rename it&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;intel_burner.bbl&lt;/code&gt;&lt;span&gt;. Edit this file to specify the Intel HEX format and output a file with an extension of&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;.hex&lt;/code&gt;&lt;span&gt;, to distinguish it from the S-Record file, which has an extension of&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;.s19.&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;The file should resemble this listing:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;OPENFILE "%ABS_FILE%.&lt;span style="color: #ff0000;"&gt;hex&lt;/span&gt;"&lt;br/&gt;format=&lt;span style="color: #ff0000;"&gt;intel&lt;/span&gt;&lt;br/&gt;busWidth=1&lt;br/&gt;origin=0&lt;br/&gt;len=0x1000000&lt;br/&gt;destination=0&lt;br/&gt;SENDBYTE 1 "%ABS_FILE%"&lt;br/&gt;CLOSE&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Elements in red have been changed from the original file. The symbol&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;%ABS_FILE%&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;represents the symbolic name of the binary artifact file generated by the tools. You will supply an argument to the burner utility program that specifies this name.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Going back to the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Build Steps&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tab of the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Build Settings&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view, in the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Command&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;option for the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Post-build steps&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;group, enter:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;"${HC08Tools}/burner.exe" -f=${ProjDirPath}/Project_Settings/Linker_Files/intel_burner.bbl \&lt;br/&gt; -envABS_FILE=${BuildArtifactFileName}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Where:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;${HC08Tools}&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;specifies the directory of the CodeWarrior HCS08 tools&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;${ProjDirPth}&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;states the path to the CodeWarrior project&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;${BuildArtifactFileName}&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;is the name of the final binary image file&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This command first launches the burner utility program,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;burner.exe&lt;/code&gt;&lt;span&gt;. Note that this argument is bracketed by quotes in case the path name contains a space. Next, the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;-f&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;argument instructs burner where to find its&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;.bbl&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;command file. Finally, the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;-env&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;argument specifies the name of the image file to process. The symbol&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;${BuildArtifactFileName}&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;feds this image file name directly into the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;%ABS_FILE%&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;symbol in the burner command file. When the project builds successfully, a file with the extension of&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;.hex&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;should appear in the project folder. The astute CodeWarrior developer might suggest that you could have simply edited the existing&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;code&gt;burner.bbl&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;file to generate the Intel HEX file, but then that wouldn't have made much of an example, right?&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;In order to write successful command lines, it behooves you to read the tool documentation carefully to see as to what environmental variables and symbols they support and can be put to work for you in the command line. In the case of the burner example, I had to read the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;HC(S)08/RS08 Build Tools Utility Manual&lt;/em&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for information on the burner program and batch burner language. Second, if you have problems, just study the output in the&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;Console&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;view as the build progresses. It will display the command line with all of the symbol substitutions made, and from that you can catch a lot of errors. Again, this adds some additional complexity for you, but in turn it gives you great flexibility in what you can do prior to or after the build process. Also, don&amp;#8217;t forget that on top of extending the build system operation, you can also&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://blogs.freescale.com/2012/04/27/scripting-welcome-to-the-debugger-shell/"&gt;&lt;span style="color: #800080;"&gt;use Tcl scripts to drive the CodeWarrior IDE&lt;/span&gt;&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;and further automate your development process.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Happy building!&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:1a99dad7-358f-45de-b209-4e0c502aa74c] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/0YqYMSvxv_o" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">codewarrior</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">eclipse</category>
      <category domain="/community/the-embedded-beat/tags">codewarrior-tool-tip</category>
      <category domain="/community/the-embedded-beat/tags">build</category>
      <category domain="/community/the-embedded-beat/tags">classic-codewarrior</category>
      <category domain="/community/the-embedded-beat/tags">post-build</category>
      <category domain="/community/the-embedded-beat/tags">post-link</category>
      <category domain="/community/the-embedded-beat/tags">pre-build</category>
      <category domain="/community/the-embedded-beat/tags">pre-link</category>
      <pubDate>Wed, 27 Jun 2012 02:39:35 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/06/26/codewarrior-tool-tip-8-extending-the-build-system</guid>
      <dc:date>2012-06-27T02:39:35Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/06/26/codewarrior-tool-tip-8-extending-the-build-system</feedburner:origLink></item>
    <item>
      <title>Freescale announces Windows 8 sensor fusion</title>
      <link>http://feedproxy.google.com/~r/freescale-software-meets-silicon/~3/hP5eyj0THxY/freescale-announces-windows-8-sensor-fusion</link>
      <description>&lt;!-- [DocumentBodyStart:27685ed3-dadb-4beb-8703-8a983c176b2b] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;strong&gt;By Michael Stanley&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;#8211; In my last post (&amp;#8220;&lt;/span&gt;&lt;a class="jive-link-blog-small" data-containerId="1010" data-containerType="37" data-objectId="1443" data-objectType="38" href="https://community.freescale.com/community/the-embedded-beat/blog/2012/03/29/degrees-of-freedom-vs-axes"&gt;Degrees of freedom vs. axes&lt;/a&gt;&lt;span&gt;&amp;rdquo;) we discussed some basic terminology for sensor fusion. This time around, we get to put that lesson into practice as we examine Freescale&amp;#8217;s recent technology announcement of a full featured reference platform for Windows&lt;/span&gt;&lt;sup&gt;&amp;reg;&lt;/sup&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;8 sensor fusion.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If you are a regular reader, you&amp;#8217;ll know by now that I am fascinated by sensors and sensor fusion software. These are the technologies that let us interface with our electronic toys with a simple tap, swipe or gesture. So I was energized last week when Freescale announced development of a 12-axis, sensor fusion reference platform for Microsoft&lt;/span&gt;&lt;sup&gt;&amp;reg;&lt;/sup&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Windows&lt;/span&gt;&lt;sup&gt;&amp;reg;&lt;/sup&gt;&lt;span&gt;8. I was at the kickoff meeting last year between Microsoft and Freescale, and I&amp;#8217;ve been watching the system evolve in our offices since. We&amp;#8217;re not quite ready to ship boards to the general market, but we&amp;#8217;re excited and want to share our plans and status with you.&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1472-1238/win8sensorfusionfigure1.jpg"&gt;&lt;img alt="win8sensorfusionfigure1.jpg" class="jive-image" height="357" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1472-1238/500-357/win8sensorfusionfigure1.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="500"/&gt;&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;Figure 1: Freescale Microsoft&amp;reg; Windows&amp;reg; 8 Sensor Fusion Data Flow&lt;/em&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;em&gt;&lt;br/&gt;&lt;/em&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;From an information flow point of view, the board looks something like Figure 1. Our 12 axes of sensor input information are:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;X/Y/Z Accelerometer&lt;/li&gt;&lt;li&gt;X/Y/Z Gyroscope&lt;/li&gt;&lt;li&gt;X/Y/Z Magnetometer&lt;/li&gt;&lt;li&gt;Barometer (air pressure)&lt;/li&gt;&lt;li&gt;Temperature&lt;/li&gt;&lt;li&gt;Ambient Light&lt;/li&gt;&lt;li style="list-style: none;"&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Each of these is available in one form or another as outputs of the system, but more importantly, the system also computes board orientation. This can come in one of several forms:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;quaternion&lt;/li&gt;&lt;li&gt;rotation matrix&lt;/li&gt;&lt;li&gt;Inclinometer Euler angles&lt;/li&gt;&lt;li style="list-style: none;"&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;You also get compass heading out of the mix. From a hardware perspective, the board looks like the block diagram in Figure 2.&lt;/span&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1472-1239/win8sensorfusionfigure2.jpg"&gt;&lt;img alt="win8sensorfusionfigure2.jpg" class="jive-image" height="313" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1472-1239/500-313/win8sensorfusionfigure2.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="500"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;Figure 2: Functional Level Block Diagram&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;span&gt;Sensor fusion software is pre-installed in the MCF51JU128 flash memory. To utilize the board, you will need a Windows&amp;reg; 8 enabled computer or slate to act as host:&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;If your device is already equipped with sensors, you'll need to disable them via the device configuration screens in Windows 8. If your device isn't already sensor equipped, you can skip this step.&lt;/li&gt;&lt;li&gt;Plug the development board into your device's USB port.&lt;/li&gt;&lt;li&gt;You are done!&lt;/li&gt;&lt;li style="list-style: none;"&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;Pure plug &amp;amp; play. That&amp;#8217;s because Microsoft has defined an &amp;#8220;HID over USB&amp;rdquo; protocol for communications with a sensor fusion subsystem. The Freescale board talks the same language as Windows 8. And since Freescale will be publishing the full schematic and bill of materials, adding motion sensor capability to your Windows PC or slate couldn&amp;#8217;t be easier.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Once the boards start shipping, you'll be able to download user manual, schematics and CAD files from the Freescale web site. The user manual will include instructions for customizing the software for use on your PCB, since placement orientations for sensors will vary from board to board. Don't worry. The process should be relatively painless.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;Freescale will also supply a basic sensor application that you can use to test out your sensor subsystem. The application gives you a visual compass display, along with either a 3D view of a virtual gyroscope (Figure 3) or a window into a virtual room (Figure 4). You can see accelerometer, gyroscope (which Microsoft refers to as a &amp;#8220;gyrometer&amp;rdquo;) magnetometer, ambient light sensor, temperature and air pressure readings.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;br/&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1472-1240/wired-screen-shot.png"&gt;&lt;img alt="wired-screen-shot.png" class="jive-image" height="400" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1472-1240/500-400/wired-screen-shot.png" style="display: block; margin-left: auto; margin-right: auto;" width="500"/&gt;&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;Figure 3: Gyroscope (wired) view&lt;/em&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="https://community.freescale.com/servlet/JiveServlet/showImage/38-1472-1241/attached-screen-shot.png"&gt;&lt;img alt="attached-screen-shot.png" class="jive-image" height="399" src="https://community.freescale.com/servlet/JiveServlet/downloadImage/38-1472-1241/500-399/attached-screen-shot.png" style="display: block; margin-left: auto; margin-right: auto;" width="500"/&gt;&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;em&gt;Figure 4: Virtual Room (attached) view&lt;/em&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;br/&gt;&lt;span&gt;Microsoft has a rigorous certification process which is encapsulated in their &amp;#8220;Windows Hardware Certification Kit&amp;rdquo;, or &amp;#8220;WHCK&amp;rdquo;. The WHCK specifies passing sensor test criteria and ensures hardware/software compatibility. Microsoftupdates the WHCK on a regular basis, and Freescale continuously tests its solution using the WHCK. Final certification of the kit will occur after Microsoft releases their final WHCK. This will occur before the Windows 8 OS release. I can tell you that the software is passing most of the WHCK today, with only a few open issues which we expect to resolve shortly.&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;A brief video demonstration of the system can be viewed in the window below.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;br/&gt;&lt;iframe frameborder="0" height="350" src="http://www.youtube.com/embed/e0HKjZZyn1o?wmode=transparent" width="425"&gt;
&lt;/iframe&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;span&gt;We expect Freescale's Windows 8 reference design to be available in late 3rd quarter, so you'll have to wait a bit. But we wanted you to know it's coming, and it's real.&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span&gt;Finally, on another topic, if you happen to be attending the Freescale Technology Forum in San Antonio next week, and you see a fellow who looks a bit like the picture alongside this post, please come up and say hello. I would love to talk with you about your sensor needs.&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="jive-link-external-small" href="http://www.buildwindows.com/"&gt;Microsoft 2001 Build Conference Materials&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="jive-link-external-small" href="http://www.microsoft.com/about/mspreview/windows8/Windows8_RP_Product_guide.pdf"&gt;Windows 8 Release Preview Product Guide for Developers&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/windows/hardware/br259128.aspx"&gt;The HID Class Driver for Sensors&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/windows/apps/br211360.aspx?ppud=4"&gt;Integrating devices, printers, and sensors&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/windows/hardware/br259127.aspx"&gt;Integrating Motion and Orientation Sensors&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="jive-link-external-small" href="http://www.microsoft.com/windows"&gt;http://www.Microsoft.com/windows&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="jive-link-external-small" href="http://www.freescale.com/Windows8"&gt;http://www.freescale.com/Windows8&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:27685ed3-dadb-4beb-8703-8a983c176b2b] --&gt;&lt;img src="http://feeds.feedburner.com/~r/freescale-software-meets-silicon/~4/hP5eyj0THxY" height="1" width="1"/&gt;</description>
      <category domain="/community/the-embedded-beat/tags">accelerometer</category>
      <category domain="/community/the-embedded-beat/tags">sensor</category>
      <category domain="/community/the-embedded-beat/tags">xtrinsic</category>
      <category domain="/community/the-embedded-beat/tags">sensors</category>
      <category domain="/community/the-embedded-beat/tags">the-embedded-beat</category>
      <category domain="/community/the-embedded-beat/tags">software-meets-silicon</category>
      <category domain="/community/the-embedded-beat/tags">smart-mobile-devices</category>
      <category domain="/community/the-embedded-beat/tags">mems</category>
      <category domain="/community/the-embedded-beat/tags">microsoft</category>
      <category domain="/community/the-embedded-beat/tags">windows-8</category>
      <pubDate>Thu, 14 Jun 2012 23:58:20 GMT</pubDate>
      <author>admin@community.freescale.com</author>
      <guid isPermaLink="false">https://community.freescale.com/community/the-embedded-beat/blog/2012/06/14/freescale-announces-windows-8-sensor-fusion</guid>
      <dc:date>2012-06-14T23:58:20Z</dc:date>
      <clearspace:dateToText>8 months, 2 days ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    <feedburner:origLink>https://community.freescale.com/community/the-embedded-beat/blog/2012/06/14/freescale-announces-windows-8-sensor-fusion</feedburner:origLink></item>
  </channel>
</rss>
