<?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: MCF52233: General Purpose Timer [GPT] in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187216#M7942</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the response, but this does not answer my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want to use GPT for generating 10ms timer. But these pins, GPT0-GPT3 are grounded in the hardware. Is it possible for me to utilize these pins to generate 10ms timer??? (I do not want to use Pulse Accumulator feature of this)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it is possible, then please provide me with the sample code, for initialising the registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot use DMA timer coz all the 3 DMA timers are utilised for other purpose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jun 2009 14:05:57 GMT</pubDate>
    <dc:creator>Lakshmi</dc:creator>
    <dc:date>2009-06-04T14:05:57Z</dc:date>
    <item>
      <title>MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187214#M7940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are&amp;nbsp;using MCF52233 processor. We want to implement GPT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have used all the 3 DMA timers, QSPI, UART, EPORT for other functionality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have switch buttons interfaced to MCF52233 processor board. These 4 switches are configured to IRQ8 to IRQ15. Two IRQ pins dedicated&amp;nbsp;for each button.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we are implementing debounce timer concept here. I checked the sampl code provided by freescale for GPT, but did not get clarity about how to do the register settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Note: These GPT pins (GPT0-GPT3) are grounded in the hardware. Is it possible for us to use these pins for the purpose of running the timer for about 10ms?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone please help me with the register settings or any sample code??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 22:01:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187214#M7940</guid>
      <dc:creator>Lakshmi</dc:creator>
      <dc:date>2009-06-03T22:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187215#M7941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no experience with this MCU. I worked on MCF5234 but I guesse it would be pretty similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is part of my code to setup DMA timer 0:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__interrupt__ void DTIM0_isr(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; MCF_TIMER_DTER0 = MCF_TIMER_DTER_REF;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void timerSetup()&amp;nbsp;&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; // Setup DMA timer 0 interrupt&lt;BR /&gt;&amp;nbsp; MCF_INTC0_ICR19 = MCF_INTC_ICR_IL(0x06) | MCF_INTC_ICR_IP(0);&lt;BR /&gt;&amp;nbsp; MCF_INTC0_IMRL &amp;amp;= ~MCF_INTC_IMRL_INT_MASK19;&lt;BR /&gt;&amp;nbsp; VECTOR_TABLE[0x53] = (int)DTIM0_isr;&lt;BR /&gt;&amp;nbsp; // Enable the DMA Timer 0&lt;BR /&gt;&amp;nbsp; MCF_TIMER_DTRR0 = 1023;&lt;BR /&gt;&amp;nbsp; MCF_TIMER_DTER0 = MCF_TIMER_DTER_REF;&lt;BR /&gt;&amp;nbsp; MCF_TIMER_DTMR0 = MCF_TIMER_DTMR_PS(8)&lt;BR /&gt;&amp;nbsp; | MCF_TIMER_DTMR_ORRI&lt;BR /&gt;&amp;nbsp; | MCF_TIMER_DTMR_FRR&lt;BR /&gt;&amp;nbsp; | MCF_TIMER_DTMR_CLK_DIV1&lt;BR /&gt;&amp;nbsp; | MCF_TIMER_DTMR_RST;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; // unmask all interrupts&lt;BR /&gt;&amp;nbsp; MCF_INTC_IMRL &amp;amp;= ~MCF_INTC_IMRL_MASKALL;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Don't forget to start global interrupt level with: &amp;nbsp;asm volatile ("move.w #2000, %sr");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck&amp;nbsp;&lt;/P&gt;&lt;P&gt;Radek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 13:48:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187215#M7941</guid>
      <dc:creator>Radek21</dc:creator>
      <dc:date>2009-06-04T13:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187216#M7942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the response, but this does not answer my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want to use GPT for generating 10ms timer. But these pins, GPT0-GPT3 are grounded in the hardware. Is it possible for me to utilize these pins to generate 10ms timer??? (I do not want to use Pulse Accumulator feature of this)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it is possible, then please provide me with the sample code, for initialising the registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot use DMA timer coz all the 3 DMA timers are utilised for other purpose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 14:05:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187216#M7942</guid>
      <dc:creator>Lakshmi</dc:creator>
      <dc:date>2009-06-04T14:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187217#M7943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Or do I have any other option, other than GPT????&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 14:06:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187217#M7943</guid>
      <dc:creator>Lakshmi</dc:creator>
      <dc:date>2009-06-04T14:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187218#M7944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The M52233 has 4 DMA timers - do you still have one free (you say you are only using three of them (?)).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also you didn't mention the PITs (Periodic Interrupt Timers). If these are still free they are easy to use for generating time delays.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise the question is a bit confusing. You write that the GPT pins are grounded and then ask whether they can be used. Are you planning on changing the HW so that they are not grounded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 17:47:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187218#M7944</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2009-06-04T17:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187219#M7945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Mark, Thanks so mush for the response. Yes the GPT pins are grounded in our hardware &amp;amp; we are not planning to alter the hardware as of now. So I need to manage with other peripherals. So according to you, PIT is more simple &amp;amp; appropriate to use, rather than GPT? I will briefly explain about what I am trying to implement. 1. We have a membrane switch connected to our customized freescale processor board. 2. There are totally 4 switches. Each switch is configured to a pair of IRQ pins [IR8 to IRQ15] 3. Due to the debounce factor, when the switch is pressed, inconsistently interrupt gets generated [Sometimes 2 or 3 or 5… just randomly] 4. So we decided to set 10ms timer for the key press &amp;amp; release. 5. For this purpose we decided to use GPT. But we aren’t sure if this could be used coz these pins are grounded in the hardware. 6. if you suggest PIT is a better option compared to GPT, can you please provide me with the sample code or register settings, if it is available with you? It would be of a great help for us. Thanks in advance&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 18:35:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187219#M7945</guid>
      <dc:creator>Lakshmi</dc:creator>
      <dc:date>2009-06-04T18:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187220#M7946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Mark,&lt;BR /&gt;&lt;BR /&gt;Thanks so mush for the response.&lt;BR /&gt;&lt;BR /&gt;Yes the GPT pins are grounded in our hardware &amp;amp; we are not planning to alter the hardware as of now.&lt;BR /&gt;&lt;BR /&gt;So I need to manage with other peripherals. So according to you, PIT is more simple &amp;amp; appropriate to use, rather than GPT?&lt;BR /&gt;&lt;BR /&gt;I will briefly explain about what I am trying to implement.&lt;BR /&gt;&lt;BR /&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; We have a membrane switch connected to our customized freescale processor board.&lt;BR /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; There are totally 4 switches. Each switch is configured to a pair of IRQ pins [IR8 to IRQ15]&lt;BR /&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp; Due to the debounce factor, when the switch is pressed, inconsistently interrupt gets generated [Sometimes 2 or 3 or 5… just randomly]&lt;BR /&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp; So we decided to set 10ms timer for the key press &amp;amp; release.&lt;BR /&gt;5.&amp;nbsp;&amp;nbsp;&amp;nbsp; For this purpose we decided to use GPT. But we aren’t sure if this could be used coz these pins are grounded in the hardware.&lt;BR /&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp; if you suggest PIT is a better option compared to GPT, can you please provide me with the sample code or register settings, if it is available with you? It would be of a great help for us.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 18:35:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187220#M7946</guid>
      <dc:creator>Lakshmi</dc:creator>
      <dc:date>2009-06-04T18:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187221#M7947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is code for MCF5485 to setup the GPTtimer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define TIMER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define DELAY_TIME &amp;nbsp; 10000 &amp;nbsp; // in uS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCF_GPT_GMS( TIMER ) = MCF_GPT_GMS_IEN | MCF_GPT_GMS_TMS_GPIO;&lt;BR /&gt;&amp;nbsp; MCF_GPT_GCIR( TIMER ) = MCF_GPT_GCIR_PRE(100) | MCF_GPT_GCIR_CNT( DELAY_TIME );&lt;BR /&gt;&amp;nbsp; MCF_GPT_GMS( TIMER ) |= MCF_GPT_GMS_CE;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be sure that CE bit is modiefied last.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you still have one free GPT timer, please use it for handling all of switches. For example: make a simple shared timer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Grounded GPT pins should not have influence to behaviour of GPT timer if you haven't enabled alternate functionality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Radek&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 19:05:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187221#M7947</guid>
      <dc:creator>Radek21</dc:creator>
      <dc:date>2009-06-04T19:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187222#M7948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the GPTs are based on a single 16 bit counter (shared between channels) it is generally not as flexible as other available timers. The PIT (there are 2 in your chip) are very easy to use to generate time delays and periodic interrupts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generally I wouldn't usually use edge interrupts with mechanical switches due to the debounce problems. Usually it is easier to poll them (based on a single timer) at say 50ms since this automatically has a debouncing effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are references to the use of the different timer types and also a discussion of debouncing the Edge port interrupts here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/forum/index.php?topic=393.0" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=393.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/forum/index.php?topic=438.0" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=438.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/forum/index.php?topic=383.msg1563#msg1563" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=383.msg1563#msg1563&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.uTasker.com" rel="nofollow" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&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>Thu, 04 Jun 2009 19:53:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187222#M7948</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2009-06-04T19:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233: General Purpose Timer [GPT]</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187223#M7949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;Hi, Thanks for the response. I will implement this &amp;amp; get back to you if I have any questions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks once again..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 15:33:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-General-Purpose-Timer-GPT/m-p/187223#M7949</guid>
      <dc:creator>Lakshmi</dc:creator>
      <dc:date>2009-06-05T15:33:22Z</dc:date>
    </item>
  </channel>
</rss>

