<?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>S12 / MagniV MicrocontrollersのトピックAsking for Input Capture Interrupt MCU S12G128 sample code</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847431#M16070</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I just new for using NXP MCU S12G128 and I want to capture digital pulse using interrupt (RISING or FALLING edge detection).&amp;nbsp;After I search all S12G128 example, I cannot find any example for using it, is there any example for that?&lt;/P&gt;&lt;P&gt;Any example would be appreciate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2018 05:28:37 GMT</pubDate>
    <dc:creator>lukmankurniawan</dc:creator>
    <dc:date>2018-07-24T05:28:37Z</dc:date>
    <item>
      <title>Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847431#M16070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I just new for using NXP MCU S12G128 and I want to capture digital pulse using interrupt (RISING or FALLING edge detection).&amp;nbsp;After I search all S12G128 example, I cannot find any example for using it, is there any example for that?&lt;/P&gt;&lt;P&gt;Any example would be appreciate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 05:28:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847431#M16070</guid>
      <dc:creator>lukmankurniawan</dc:creator>
      <dc:date>2018-07-24T05:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847432#M16071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lukman,&lt;BR /&gt;The S12G128 MCU has the same TIM16B6V3 module as S12ZVL.&lt;BR /&gt;So you can refer to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-332554"&gt;https://community.nxp.com/docs/DOC-332554&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 09:11:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847432#M16071</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-07-24T09:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847433#M16072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I use &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;S12G128 MCU&amp;nbsp;and use&amp;nbsp;&lt;/SPAN&gt;code warrior 5.9.0 version,I cannot import the example you give to me.&lt;BR /&gt;Also Any simple example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2018 01:38:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847433#M16072</guid>
      <dc:creator>lukmankurniawan</dc:creator>
      <dc:date>2018-07-25T01:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847434#M16073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lukman,&lt;/P&gt;&lt;P&gt;We don't have this example ported on S12G.&lt;/P&gt;&lt;P&gt;You can't&amp;nbsp;import that project, however, you can reuse the TIM code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 13:06:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847434#M16073</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-07-26T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847435#M16074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, I will try to reuse it.&lt;/P&gt;&lt;P&gt;I will let you know if get problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2018 01:03:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847435#M16074</guid>
      <dc:creator>lukmankurniawan</dc:creator>
      <dc:date>2018-07-27T01:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847436#M16075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just created following the example you given, then I connect PT0 to function generator, but&amp;nbsp;as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I check variables such as TC0&amp;nbsp;&amp;amp;&amp;nbsp;overflow why it doesn't change/increase? what is the problem?&amp;nbsp; the code as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG NON_BANKED&lt;BR /&gt;interrupt void TIM0_ISR(void)&lt;BR /&gt;{&lt;BR /&gt;overflow++;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TFLG2 = 0x80; //clear interrupt flag&lt;BR /&gt;}&lt;BR /&gt;//===========================&lt;BR /&gt;// Input Capture Interrupt channel 0&lt;BR /&gt;//===========================&lt;BR /&gt;interrupt void IC0_ISR(void)&lt;BR /&gt;{&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;new_capture = TC0; //save the value of input capture register&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if(first_edge != 0) //first_edge just take care about the first calculating when we don't know the value of previous input&lt;BR /&gt;{&lt;BR /&gt;//calculate the number of bus cycles//////////////&lt;BR /&gt;number_of_cycles = (0xFFFF * (unsigned long int)overflow) + new_capture - old_capture;&lt;BR /&gt;frequency = BUS_CLOCK/number_of_cycles;&lt;/P&gt;&lt;P&gt;}&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;else&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;first_edge = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;overflow = 0;&lt;BR /&gt;old_capture = new_capture; //save the IC for next using&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TFLG1 = 0x01; //clear interrupt flag on channel 0 (channel1= 0x02, channel2=0x04, channel3=0x08)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;}&lt;BR /&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//==========================&lt;BR /&gt;// InitInputCapture for channel 0//&lt;BR /&gt;//==========================&lt;BR /&gt;void InitInputCapture_0(void)&lt;BR /&gt;{&lt;BR /&gt;PPST_PPST0 = 0; //set pull-up PPST0 (pull-up=0, pull-down=1)&lt;BR /&gt;PERT_PERT0 = 1; //enable pull-up on PERT0&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TSCR1 = 0xE0;//0xF0;//enable timer, stop timer during wait and freeze, disable fast flag clear&lt;BR /&gt;TIOS_IOS0 = 0; //channel 0 as an input capture (input capture=0, output compare=1)&lt;BR /&gt;TCTL4 = 0x01; //capture on rising edge&lt;BR /&gt;TIE_C0I = 1; //enable interrupt on channel 0&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;TSCR2 = 0x80; //timer overflow interrupt enable, counter free runs, timer prescaler is 1&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PE_low_level_init();&lt;BR /&gt;InitInputCapture_0(); ///Input Capture Interrupt//&lt;BR /&gt;EnableInterrupts; ///Enable interrupt//&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2018 08:59:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847436#M16075</guid>
      <dc:creator>lukmankurniawan</dc:creator>
      <dc:date>2018-07-30T08:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847437#M16076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you please share the whole test project including PE configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Daniel&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 10:49:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847437#M16076</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-07-31T10:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847438#M16077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have modified my code, now the interrupt is happen, but only once. Would you kindly check my project?&lt;BR /&gt;I attached my project on attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I appreciate your help.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Lukman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2018 05:44:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847438#M16077</guid>
      <dc:creator>lukmankurniawan</dc:creator>
      <dc:date>2018-08-01T05:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847439#M16078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I see It has been resolved in this thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/358694"&gt;https://community.nxp.com/thread/358694&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2018 08:30:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847439#M16078</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-08-02T08:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for Input Capture Interrupt MCU S12G128 sample code</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847440#M16079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes it solved already, many thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 00:57:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Asking-for-Input-Capture-Interrupt-MCU-S12G128-sample-code/m-p/847440#M16079</guid>
      <dc:creator>lukmankurniawan</dc:creator>
      <dc:date>2018-08-03T00:57:22Z</dc:date>
    </item>
  </channel>
</rss>

