<?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 Timing measurement in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Timing-measurement/m-p/680427#M13965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a comparator to measure the time for a capacitor to charge up through a resistor, the other end of which is tied to a port pin. The time measured is then used to determine the value of the resistor (actually a NTC thermistor) and hence the temperature. The comparator uses component &lt;EM&gt;CMP1&lt;/EM&gt; with the on-chip bandgap voltage as the + input. I am using &lt;EM&gt;FC161:GetTicks16&lt;/EM&gt; to measure the time taken for the comparator to switch. Using the DEMOQE board everything worked fine and I was getting values of 19000 @ 25 degs and 300 @ 150 degs (comparable to results on a different processor type). I then moved over to a target board (S08SH4) which used identical components, but the values were 390 and 250. The comparator input waveforms were the same in both cases and I could see that the comparator tripped at the same point in time and voltage. It would appear that there is a timing issue as not only are the values different but the %ag change is also different.&lt;/P&gt;&lt;P&gt;Any help would be gratefully received.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jun 2017 12:46:44 GMT</pubDate>
    <dc:creator>juliancox</dc:creator>
    <dc:date>2017-06-30T12:46:44Z</dc:date>
    <item>
      <title>Timing measurement</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Timing-measurement/m-p/680427#M13965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a comparator to measure the time for a capacitor to charge up through a resistor, the other end of which is tied to a port pin. The time measured is then used to determine the value of the resistor (actually a NTC thermistor) and hence the temperature. The comparator uses component &lt;EM&gt;CMP1&lt;/EM&gt; with the on-chip bandgap voltage as the + input. I am using &lt;EM&gt;FC161:GetTicks16&lt;/EM&gt; to measure the time taken for the comparator to switch. Using the DEMOQE board everything worked fine and I was getting values of 19000 @ 25 degs and 300 @ 150 degs (comparable to results on a different processor type). I then moved over to a target board (S08SH4) which used identical components, but the values were 390 and 250. The comparator input waveforms were the same in both cases and I could see that the comparator tripped at the same point in time and voltage. It would appear that there is a timing issue as not only are the values different but the %ag change is also different.&lt;/P&gt;&lt;P&gt;Any help would be gratefully received.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 12:46:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Timing-measurement/m-p/680427#M13965</guid>
      <dc:creator>juliancox</dc:creator>
      <dc:date>2017-06-30T12:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Timing measurement</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Timing-measurement/m-p/680428#M13966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps I should make my problem a little simpler: -&lt;/P&gt;&lt;P&gt;I have a capacitor being charged through a resistor. The resistor is fed by a port pin. and the capacitor voltage is fed to Comparator CPM1 - pin and the + pin is connected to the internal bandage supply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I calculate that the time for the comparator to switch should be approx. 9ms and when I measure the time on an oscilloscope it is approx. 9ms.&lt;/P&gt;&lt;P&gt;When I activate the charging process I also reset and start component FC161:FreeCntr16. In the comparator ISR I read register TPM1CNT.&lt;/P&gt;&lt;P&gt;Using my DEMOQE I read approximately 18000 ticks which, with a 4MHz clock gives a tick frequency of 2MHz, which equates to 18000 ticks for 9ms. So far - so good.&lt;/P&gt;&lt;P&gt;Using my target S08SH4 board the comparator switches after 9ms, but I only get a tick count of 350.&lt;/P&gt;&lt;P&gt;I have checked everything I can, but where do I go next&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jul 2017 08:22:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Timing-measurement/m-p/680428#M13966</guid>
      <dc:creator>juliancox</dc:creator>
      <dc:date>2017-07-02T08:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timing measurement</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Timing-measurement/m-p/680429#M13967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Julian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please notice that the Bandgap Voltage Reference for the S08QE MCU has a typical value of 1.17 V (factory trimmed at VDD = 3.0 V) and the S08SH MCU has a typical value of 1.20 V (factory trimmed at VDD = 5.0 V) so you will not have the same reference voltage in the compataros CPM1 + pin. Regarding the timer, are you selecting the same clock&lt;BR /&gt;source and prescale factor? Also, are you trimming both devices to the same frequency?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Carlos Mendoza&lt;BR /&gt;Technical Support Engineer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 16:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Timing-measurement/m-p/680429#M13967</guid>
      <dc:creator>Carlos_Mendoza</dc:creator>
      <dc:date>2017-07-14T16:54:52Z</dc:date>
    </item>
  </channel>
</rss>

