<?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: DV16 TPM Question - UPDATE in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159451#M9488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Further investigation has revealed writing to the TPM status and control clock select bits(TPM2SC_CLKSx), prior to writing to the TPM Modulo register (TPM2MOD) prevents writing to the modulo register.&amp;nbsp; The behavior is repeatable on TPM1 and TPM2&amp;nbsp;on at least two different DV16 MCU test subjects.&amp;nbsp; Writing to the modulo register first causes the write to be accepted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anybody reading this has any ideas or could re-create, I would greatly appreciate it.&amp;nbsp; I assume there is some coherency lockout or poorly documented order of events issue catching me here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing I have tried is resetting the overflow bit (TOF) prior to writing the modulo register, still no good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on a serious deadline, any advice would be great.&lt;/P&gt;&lt;P&gt;Doug&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Nov 2010 09:18:28 GMT</pubDate>
    <dc:creator>dwhansel</dc:creator>
    <dc:date>2010-11-01T09:18:28Z</dc:date>
    <item>
      <title>DV16 TPM Question</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159450#M9487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I seem to have an issue successfully writing to the modulo register on my 9s08dv16 MCU.&amp;nbsp; I am quite puzzled, here is what it is doing:&lt;/P&gt;&lt;P&gt;c -source&lt;/P&gt;&lt;P&gt;TPM2CNT = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;TPM2MOD = 0x0460; /* 280uS @ 0.25uS/bit */&lt;BR /&gt;TPM2SC_TOIE = 1; /* enable the modulus interrupt */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;assembly&lt;/P&gt;&lt;P&gt;CLRH&lt;/P&gt;&lt;P&gt;STHX&amp;nbsp; _TPM2CNT.Word&lt;/P&gt;&lt;P&gt;LDHX&amp;nbsp; #0x0460&lt;/P&gt;&lt;P&gt;STHX&amp;nbsp; _TPM2MOD.Word&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I step through this code, the TPM2 modulo register at address 0x63-0x64 remains at zero.&amp;nbsp; HX is being properly loaded with 0x0460, the STHX command appears to be executed, but the reported memory location doesn't change.&amp;nbsp; I can&amp;nbsp;set the location directly using the PE micro multilink debugger interface with CW 6.3 debugger and it works fine.&amp;nbsp; It behaves the same regardless of debugger attached or not(verified with o-scope).&amp;nbsp; It also behaves the same if I break the write into high byte and low byte.&amp;nbsp; Also, I don't completely understand the coherency mechanism so I wrote a value that was a couple of timer ticks higher then the current timer value to see if the location would update when TPM2CNT == TPM2MOD-1, no effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Doug&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Oct 2010 08:58:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159450#M9487</guid>
      <dc:creator>dwhansel</dc:creator>
      <dc:date>2010-10-30T08:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: DV16 TPM Question - UPDATE</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159451#M9488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Further investigation has revealed writing to the TPM status and control clock select bits(TPM2SC_CLKSx), prior to writing to the TPM Modulo register (TPM2MOD) prevents writing to the modulo register.&amp;nbsp; The behavior is repeatable on TPM1 and TPM2&amp;nbsp;on at least two different DV16 MCU test subjects.&amp;nbsp; Writing to the modulo register first causes the write to be accepted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anybody reading this has any ideas or could re-create, I would greatly appreciate it.&amp;nbsp; I assume there is some coherency lockout or poorly documented order of events issue catching me here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing I have tried is resetting the overflow bit (TOF) prior to writing the modulo register, still no good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on a serious deadline, any advice would be great.&lt;/P&gt;&lt;P&gt;Doug&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Nov 2010 09:18:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159451#M9488</guid>
      <dc:creator>dwhansel</dc:creator>
      <dc:date>2010-11-01T09:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: DV16 TPM Question - UPDATE</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159452#M9489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Doug,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, there is a coherency mechanism for updating the 16-bit registers within the TPM module, including TPMxMOD.&amp;nbsp; The channel registers are also affected, and unfortunately there are signiffican coherency mechanism&amp;nbsp;differences between V1, V2 and V3 modules.&amp;nbsp; The following post addresses update of channel registers for V3 modules, and may be of general interest.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.freescale.com/message/62954#62954" title="https://community.freescale.com/message/62954#62954"&gt;https://community.freescale.com/message/62954#62954&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To achieve immediate update of the TPMxMOD setting, I suggest&amp;nbsp;this should be done with the TPMxSC_CLKS setting at 00 (clock disabled).&amp;nbsp;&amp;nbsp;Update should then occur when the second byte is written, and will be independent of the prescale setting.&amp;nbsp; Otherwise, the update would be delayed until the next TPM clock edge, from the prescaler.&amp;nbsp; Within this period, it is possible for&amp;nbsp;other TPM&amp;nbsp;register writes to clear the coherency mechanism, so the value never gets updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another possibility is to test and wait for the updated value before any other TPM&amp;nbsp;register writes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Nov 2010 12:09:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159452#M9489</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-11-01T12:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: DV16 TPM Question - UPDATE</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159453#M9490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mac, zeroing the CLKS priort to writing the MOD register worked for me.&amp;nbsp; I am still not sure what advantage this design "feature" provides, but I can work around it now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doug&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 10:49:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/DV16-TPM-Question/m-p/159453#M9490</guid>
      <dc:creator>dwhansel</dc:creator>
      <dc:date>2010-11-09T10:49:12Z</dc:date>
    </item>
  </channel>
</rss>

