<?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: rising edge detection in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206612#M9843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm assuming you are using a DMA timer in capture mode. You should configure the corresponding port to assume it's 'primary function' using the PTCPAR register.&lt;/P&gt;&lt;P&gt;For easy peripheral configuration, use the CFInit tool:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.microapl.co.uk/CFInit/cfinit_main.html" rel="nofollow" target="_self"&gt;CFInit ColdFire Initialization Tool&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jun 2010 21:19:56 GMT</pubDate>
    <dc:creator>scifi</dc:creator>
    <dc:date>2010-06-11T21:19:56Z</dc:date>
    <item>
      <title>rising edge detection</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206611#M9842</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;i'm working on a project with the MCF52259 demokit board. We have to implement a sonic waves sensor.&lt;/P&gt;&lt;P&gt;A command is sent to the sensor (trigger pulse 50us) and the sensor answers with an echo pulse from 100us to 50ms (depends on the detected distance). The microcontroler has to count the pulse width.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I have is the microcontroler doesn't detect the rising edge on the output sensor (the pin used is the first pin of the TC GPIO port). I supppose the gpio is bad configured but i dont know where is the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I notice the MCF_GPIO_PORTTC port is connected to the leds and used to display them but I dont think that could be the problem.&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;jérémie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 19:53:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206611#M9842</guid>
      <dc:creator>Jeremius</dc:creator>
      <dc:date>2010-06-11T19:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: rising edge detection</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206612#M9843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm assuming you are using a DMA timer in capture mode. You should configure the corresponding port to assume it's 'primary function' using the PTCPAR register.&lt;/P&gt;&lt;P&gt;For easy peripheral configuration, use the CFInit tool:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.microapl.co.uk/CFInit/cfinit_main.html" rel="nofollow" target="_self"&gt;CFInit ColdFire Initialization Tool&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 21:19:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206612#M9843</guid>
      <dc:creator>scifi</dc:creator>
      <dc:date>2010-06-11T21:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: rising edge detection</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206613#M9844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CFinit works with MCF5225x family ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I use DMA timer 0 capture on rising edge, but i dont think i can use any ports (for the capture)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jun 2010 06:41:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206613#M9844</guid>
      <dc:creator>Jeremius</dc:creator>
      <dc:date>2010-06-12T06:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: rising edge detection</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206614#M9845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Jeremius wrote:&lt;BR /&gt;&lt;P&gt;CFinit works with MCF5225x family ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The MCF5225x shares many peripherals with the MCF5223x and others. That makes it possible to use CFInit with the MCF5225x.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jun 2010 15:22:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206614#M9845</guid>
      <dc:creator>scifi</dc:creator>
      <dc:date>2010-06-12T15:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: rising edge detection</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206615#M9846</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;CFInit is really nice but i still have problems for my project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GPIO 1 is an output, I send a trigger pulse (1OOus)&amp;nbsp;to enable the sensor.&lt;/P&gt;&lt;P&gt;DTIN0 is an input, i receive a pulse from the sensor and i want to to count the pulse width.&lt;/P&gt;&lt;P&gt;I used DMA Timer 0 in interrupt mode (i didnt choose capture mode) on either rising and falling edges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rising edge and falling edge seem to work but the counter values are always the same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code is really simply, that s why i posted it&lt;/P&gt;&lt;PRE&gt;voidleds_init(void){    /* Enable signals as GPIO */    MCF_GPIO_PTCPAR = 0        | MCF_GPIO_PTCPAR_DTIN3_GPIO        | MCF_GPIO_PTCPAR_DTIN2_GPIO        | MCF_GPIO_PTCPAR_DTIN1_GPIO        | MCF_GPIO_PTCPAR_DTIN0_DTIN0; //dtin0 is an input        /* Enable signals as digital outputs */    MCF_GPIO_DDRTC = 0        | MCF_GPIO_DDRTC_DDRTC3        | MCF_GPIO_DDRTC_DDRTC2        | MCF_GPIO_DDRTC_DDRTC1; MCF_GPIO_PORTTC = 0x00; // TURN LEDS OFF}voidboard_led_display(uint8 number){    /* Set output values */    MCF_GPIO_PORTTC = number;}__interrupt__ voiddtim0_handler(void){static int rise_fall = 0; if (rise_fall == 0) {  COUNT_R = MCF_DTIM0_DTCN;  MCF_DTIM0_DTCN = 0;  rise_fall = 1; } else {  COUNT_F = MCF_DTIM0_DTCN; }    /* Clear the interrupt event */    MCF_DTIM0_DTER |= MCF_DTIM_DTER_REF;}void main (void){    MCF_INTC0_ICR19 = MCF_INTC_ICR_IL(7) | MCF_INTC_ICR_IP(7);    MCF_INTC0_IMRL &amp;amp;= ~(MCF_INTC_IMRL_INT_MASK19 | MCF_INTC_IMRL_MASKALL);    /* Set the interrupt handlers in the vector table */    mcf5xxx_set_handler(64 + 19, (ADDRESS)dtim0_handler);  /* Initialize the LED's */ leds_init();     /* Global interrupt enable */ mcf5xxx_irq_enable();    /* Configure DTIM0 as a timeout counter */    MCF_DTIM0_DTCN = 0;    MCF_DTIM0_DTXMR = 0;    MCF_DTIM0_DTRR = MCF_DTIM_DTRR_REF(0xffffffff); //MCF_DTIM0_DTRR  = (DELAY - 1);    MCF_DTIM0_DTMR  = 0     | MCF_DTIM_DTMR_CE(0x3)        | MCF_DTIM_DTMR_PS(SYS_CLK_MHZ)        | MCF_DTIM_DTMR_FRR        | MCF_DTIM_DTMR_CLK_DIV1        | MCF_DTIM_DTMR_RST;    while (1)      {        /* Send trigger pulse on GPIO 1 */        board_led_display(2);        delay(1000);        board_led_display(0);        delay(10000000); //wait input signal (    }}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jérémie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 18:17:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206615#M9846</guid>
      <dc:creator>Jeremius</dc:creator>
      <dc:date>2010-06-18T18:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: rising edge detection</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206616#M9847</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;great I fixed my problems &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;currently the DTMA timer didnt want to be re-initilialized to zero but i can manage it without&lt;/P&gt;&lt;P&gt;didnt understand why MCF_DTIM0_DTCN = 0; does not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 20:49:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rising-edge-detection/m-p/206616#M9847</guid>
      <dc:creator>Jeremius</dc:creator>
      <dc:date>2010-06-18T20:49:49Z</dc:date>
    </item>
  </channel>
</rss>

