<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックNewbie - Starting a timer and reading timer counter TCN on a 68302</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-Starting-a-timer-and-reading-timer-counter-TCN-on-a-68302/m-p/189748#M8210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am trying to start timer2 and read the timer counter value (TCN2), once I have started the timer I am expecting to the see the TCN2 value incrementing, but I see no change in the TCN2 value.&amp;nbsp; I am starting the timer thus:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* This is the timer 2 mode register set up -&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 000B hex, 11 decimal or&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 0000 0000 0000 1011 binary -&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PS&amp;nbsp;&amp;nbsp; = (0000 0000) divide the clock by 1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CE&amp;nbsp;&amp;nbsp; = (00) disable int on capture,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; OM&amp;nbsp;&amp;nbsp; = (0) active low pulse for one clock cycle (62.5ns),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ORI&amp;nbsp; = (0) enable interrupt on reaching reference val,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; FRR&amp;nbsp; = (1) reset count on timeout,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ICLK = (01) source - master clock,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; RST&amp;nbsp; = (1) enable timer */&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;#define SETTIMER2MODE 0x000B&lt;/DIV&gt;&lt;DIV&gt;#define TCN2&amp;nbsp; 0x856&lt;BR /&gt;#define TMR2&amp;nbsp; 0x850&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* Set up the timer 2 mode register */&lt;BR /&gt;Poke16(BASE + TMR2, SETTIMER2MODE);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Poke is a library function, which works since I can see the value 0x000B at the address of 0x850 + BASE&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So as I understand it Timer2 should now be running and will roll round when it reaches 65535.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When running in the simulator I then examine TNC1 expecting it to be incrementing in time with the clock but there is no value at TCN2.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What's wrong?&amp;nbsp; Any ideas anyone?&amp;nbsp; Thanks.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Compiler - Cosmic IdeaCPU32&lt;BR /&gt;Simulator - Cosmic ZAP&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Sep 2008 19:13:14 GMT</pubDate>
    <dc:creator>eSteve</dc:creator>
    <dc:date>2008-09-30T19:13:14Z</dc:date>
    <item>
      <title>Newbie - Starting a timer and reading timer counter TCN on a 68302</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-Starting-a-timer-and-reading-timer-counter-TCN-on-a-68302/m-p/189748#M8210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am trying to start timer2 and read the timer counter value (TCN2), once I have started the timer I am expecting to the see the TCN2 value incrementing, but I see no change in the TCN2 value.&amp;nbsp; I am starting the timer thus:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* This is the timer 2 mode register set up -&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 000B hex, 11 decimal or&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 0000 0000 0000 1011 binary -&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PS&amp;nbsp;&amp;nbsp; = (0000 0000) divide the clock by 1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CE&amp;nbsp;&amp;nbsp; = (00) disable int on capture,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; OM&amp;nbsp;&amp;nbsp; = (0) active low pulse for one clock cycle (62.5ns),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ORI&amp;nbsp; = (0) enable interrupt on reaching reference val,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; FRR&amp;nbsp; = (1) reset count on timeout,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ICLK = (01) source - master clock,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; RST&amp;nbsp; = (1) enable timer */&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;#define SETTIMER2MODE 0x000B&lt;/DIV&gt;&lt;DIV&gt;#define TCN2&amp;nbsp; 0x856&lt;BR /&gt;#define TMR2&amp;nbsp; 0x850&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/* Set up the timer 2 mode register */&lt;BR /&gt;Poke16(BASE + TMR2, SETTIMER2MODE);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Poke is a library function, which works since I can see the value 0x000B at the address of 0x850 + BASE&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So as I understand it Timer2 should now be running and will roll round when it reaches 65535.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When running in the simulator I then examine TNC1 expecting it to be incrementing in time with the clock but there is no value at TCN2.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What's wrong?&amp;nbsp; Any ideas anyone?&amp;nbsp; Thanks.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Compiler - Cosmic IdeaCPU32&lt;BR /&gt;Simulator - Cosmic ZAP&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 19:13:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-Starting-a-timer-and-reading-timer-counter-TCN-on-a-68302/m-p/189748#M8210</guid>
      <dc:creator>eSteve</dc:creator>
      <dc:date>2008-09-30T19:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie - Starting a timer and reading timer counter TCN on a 68302</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-Starting-a-timer-and-reading-timer-counter-TCN-on-a-68302/m-p/189749#M8211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Kalvin,&lt;BR /&gt;&lt;BR /&gt;I think you misunderstood the bit FRR. It resets the counter to the refvalue&lt;BR /&gt;So depending on the refvalue the counter value might seem to stay the same.&lt;BR /&gt;I would suggest:&lt;BR /&gt;- stop the timer&lt;BR /&gt;- set the refvalue&lt;BR /&gt;- start the timer&lt;BR /&gt;Regards, Georg&lt;BR /&gt;.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 13:52:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-Starting-a-timer-and-reading-timer-counter-TCN-on-a-68302/m-p/189749#M8211</guid>
      <dc:creator>taigbr</dc:creator>
      <dc:date>2008-10-01T13:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie - Starting a timer and reading timer counter TCN on a 68302</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-Starting-a-timer-and-reading-timer-counter-TCN-on-a-68302/m-p/189750#M8212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;taigbr,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thanks for your help, I have jiggled it around some what, bearing in mind your comments, however I am not certian the emulator is correctly simulating the timers so will try it on some hardware.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Kalvin&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2008 15:11:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Newbie-Starting-a-timer-and-reading-timer-counter-TCN-on-a-68302/m-p/189750#M8212</guid>
      <dc:creator>eSteve</dc:creator>
      <dc:date>2008-10-02T15:11:18Z</dc:date>
    </item>
  </channel>
</rss>

