<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ICG Variance - MC9S08AW16 in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186147#M13952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I recommend that you submit a service request to P&amp;amp;E asking them the proper way to do this.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Sep 2008 19:40:44 GMT</pubDate>
    <dc:creator>JimDon</dc:creator>
    <dc:date>2008-09-20T19:40:44Z</dc:date>
    <item>
      <title>ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186135#M13940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;I am using the MC9S08AW16 as a motor control supervisor and speed control. I am using Codewarrior 5.9 and processor expert for initialization and using the ICG as main clock.&amp;nbsp; I&amp;nbsp; monitor motor speed by monitoring a hall effect sensor in the motor.&amp;nbsp; When the hall effect sensor triggers, I start a timer and measure time until the next hall event.&amp;nbsp; This has worked pretty well for the first few boards, but the latest board is significantly off in measurement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is my code to measure the time:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void getperiod(void){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; TPM2MOD = 0xffff;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; KBI1PE_KBIPE0 = 1; // enable keyboard enable bit 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; KBI1SC_KBACK = 1; // clear interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; while(!KBI1SC_KBF); // wait for keyboard interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; KBI1SC_KBACK = 1; // clear interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; TPM2CNT = 0;&amp;nbsp; // zero the timer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; while(!KBI1SC_KBF); // wait for keyboard interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; KBI1SC_KBACK = 1; // clear interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; HallPeriod = TPM2CNT; // total period&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could this be due to variance in the ICG? What is the best way to check this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-paul&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;Added p/n to subject.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by NLFSJ on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-09-16&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;03:42 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 20:38:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186135#M13940</guid>
      <dc:creator>plaiming</dc:creator>
      <dc:date>2008-09-16T20:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186136#M13941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello Paul,&lt;BR /&gt;&lt;BR /&gt;Hmmm, Why aren't you using the input capture on the timer for this?&lt;BR /&gt;You are using KBI but then polling for the flag???&lt;BR /&gt;You are then manually resetting and capturing the counter value after further polling.&lt;BR /&gt;This is what the input capture mode of the timer is specifically designed for why are you doing it so inefficiently?&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 08:45:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186136#M13941</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-09-17T08:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186137#M13942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello Paul,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In addition to the interrupt latency issue, as identified by Peg, have you programmed the trim value, and does your&amp;nbsp;code then read that value, within flash, and set the ICGTRM register?&amp;nbsp; If this is not done, the&amp;nbsp;ICG internal reference&amp;nbsp;frequency could be +/-25 percent from nominal value.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is it possible that the calibration and programming of the trim value&amp;nbsp;was inadvertently omitted&amp;nbsp;for the later boards?&amp;nbsp; To detect&amp;nbsp;whether this omission may have occurred during production, it is wise to provide a "sanity check" within your initialisation code, to test if the flash byte still&amp;nbsp;contains the unprogrammed value of 0xFF.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 11:56:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186137#M13942</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-09-17T11:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186138#M13943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&amp;gt;Hmmm, Why aren't you using the input capture on the timer for this?&lt;BR /&gt;&amp;gt;You are using KBI but then polling for the flag???&lt;BR /&gt;&amp;gt;You are then manually resetting and capturing the counter value after further polling.&lt;BR /&gt;&amp;gt;This is what the input capture mode of the timer is specifically designed for why are you doing it so &amp;gt;inefficiently?&lt;BR /&gt;&lt;BR /&gt;Honestly, I dont know about the input caputre mode of the timer...&lt;BR /&gt;This may not be the most efficient way to set it up but I dont know why it wouldnt be consistent enough for what im doing..Wait for the flag, clear it, start the timer, wait for the flag again, read the timer...&lt;BR /&gt;&lt;BR /&gt;Ill look into the mode you mention. I still think there is something quite different which is giving&lt;BR /&gt;me a consistently different timer value on one particular chip.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 12:11:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186138#M13943</guid>
      <dc:creator>plaiming</dc:creator>
      <dc:date>2008-09-17T12:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186139#M13944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;gt;In addition to the interrupt latency issue, as identified by Peg, have you programmed the trim value, and does&lt;BR /&gt;&amp;gt;your&amp;nbsp;code then read that value, within flash, and set the ICGTRM register?&amp;nbsp; If this is not done, the&amp;nbsp;ICG&lt;BR /&gt;&amp;gt;internal reference&amp;nbsp;frequency could be +/-25 percent from nominal value.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Unless this is done with the normal default processor expert initialization sequence, no, I am not programming or verifying the trim value.&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by plaiming on &lt;SPAN class="date_text"&gt;2008-09-17&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:14 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 12:13:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186139#M13944</guid>
      <dc:creator>plaiming</dc:creator>
      <dc:date>2008-09-17T12:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186140#M13945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Paul,&lt;BR /&gt;&lt;BR /&gt;Is this inaccurate board always the same value or is it giving a varying value over time? If it is consistent but different from another then the issue is very likely one of an untrimmed internal clock. It holds its frequency quite well but can be a fair bit out "out of the box"&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 12:38:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186140#M13945</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-09-17T12:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186141#M13946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Paul,&lt;BR /&gt;&lt;BR /&gt;What you have should be pretty accurate as long as there are no interrupts occurring to introduce random delays. Also it is OK if you are prepared to block while waiting for the event to occur. However the input capture does all this for you in the background in hardware, immune from interrupts etc.&lt;BR /&gt;&lt;BR /&gt;Also I see here I have the answer to my other question. Looks like this particular device has an untrimmed oscillator that is a little further out than the others. What are you using to connect to the device? It can probably calculate the required trim value for you.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 12:44:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186141#M13946</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-09-17T12:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186142#M13947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yes, the measurement was as consistent as the other boards. The time measurement was the&lt;BR /&gt;same but the ACTUAL time seemed to be different.&lt;BR /&gt;&lt;BR /&gt;I am not using any interrupts in my application - so i am simply calling the function when&lt;BR /&gt;I want to sample the speed, and blocking until i get a result. This is acceptable for now.&lt;BR /&gt;&lt;BR /&gt;Why are the oscillators not trimmed during manufacturing test? What do I need to&lt;BR /&gt;do to trim the oscillator properly?&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 21:21:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186142#M13947</guid>
      <dc:creator>plaiming</dc:creator>
      <dc:date>2008-09-17T21:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186143#M13948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&amp;gt; What are you using to connect to the device? It can probably calculate the required trim value for you.&lt;BR /&gt;&lt;BR /&gt;I have both a P&amp;amp;E multilink and cyclone pro is that is what you are referring to.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 04:25:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186143#M13948</guid>
      <dc:creator>plaiming</dc:creator>
      <dc:date>2008-09-18T04:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186144#M13949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello Paul,&lt;BR /&gt;&lt;BR /&gt;A factory calculated trim value is programmed into a reserved flash location at $FFBE. It is up to the user code to move this value into the active RAM based register at $4E where it will be used to trim the ICG.&lt;BR /&gt;When you mass erase the device you will destroy this value. Due to other factors like temperature and operating voltage you should calculate this value yourself in circuit. Code warrior has an option under the Multilink/Cyclone Pro menu for the BDM adapter to calculate this value and programme it into the non-volatile location used by the factory. It is still up to the user code to sanity check the value and then move it to the working register ($4E). So during development, usually you erase and re-calculate/re programme this trim value on every test cycle.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 06:40:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186144#M13949</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-09-18T06:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186145#M13950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Peg,&lt;BR /&gt;&lt;BR /&gt;Thanks for the information. I am still a little confused what I need to do for production. In production, we are using a cyclone pro to program the chips in circuit. We are getting some percentage of units where the ICG appears to be off enough to cause our control functionality to be out of spec.&amp;nbsp; These units were never used for development so I dont think they would have been mass erased unless that is what the cyclone pro does before programming.&lt;BR /&gt;&lt;BR /&gt;I do not see an option in the cyclone pro image manager utility to compute and program the $FFBE location with ICGTRM value.&amp;nbsp; What do you recommed we do.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-paul&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2008 01:45:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186145#M13950</guid>
      <dc:creator>plaiming</dc:creator>
      <dc:date>2008-09-20T01:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186146#M13951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Paul,&lt;BR /&gt;&lt;BR /&gt;I have never used a Cyclone Pro etc so I am not familiar with them.&lt;BR /&gt;It is quite usual to have a programming script do a mass erase first, just so it works every time, already programmed or not. You have not confirmed here that you have your code moving the trim value to the working register. As for the ones already programmed, connect with the debugger and check what is happening. If there is $80 in $4E in more than a couple then you are not trimming properly.&lt;BR /&gt;&lt;BR /&gt;I am sure you can set up a Cyclone to calculate and programme trim when it is operating standalone, you just need to work out how to set it up. Or maybe someone else familiar with these might help out here.&lt;BR /&gt;Simply programme these again ensuring the trimming is done correctly to fix them.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2008 05:44:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186146#M13951</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-09-20T05:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: ICG Variance - MC9S08AW16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186147#M13952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I recommend that you submit a service request to P&amp;amp;E asking them the proper way to do this.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2008 19:40:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ICG-Variance-MC9S08AW16/m-p/186147#M13952</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-09-20T19:40:44Z</dc:date>
    </item>
  </channel>
</rss>

