<?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>Kinetis MicrocontrollersのトピックPWM with FTM1 and channel 1 : The program hangs. Works fine for FTM2 and channel 3</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PWM-with-FTM1-and-channel-1-The-program-hangs-Works-fine-for/m-p/1002064#M55906</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 am working with FRDM-KE06Z custom board. I have imported ftm_simple_pwm program in to my MCUXpresso IDE and started working on it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this code I see that they are using FTM2 and channel 3. And FTM2_IRQn. Like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BOARD_FTM_BASEADDR FTM2&lt;BR /&gt;#define BOARD_FTM_CHANNEL kFTM_Chnl_3&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define FTM_INTERRUPT_NUMBER FTM2_IRQn&lt;BR /&gt;#define FTM_LED_HANDLER FTM2_IRQHandler&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define FTM_CHANNEL_INTERRUPT_ENABLE kFTM_Chnl3InterruptEnable&lt;BR /&gt;#define FTM_CHANNEL_FLAG kFTM_Chnl3Flag&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define FTM_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_TimerClk)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the main function in the&amp;nbsp;&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;/P&gt;&lt;P&gt;inside&amp;nbsp;BOARD_InitPins(); function they are using corresponsding pin.&amp;nbsp;&lt;/P&gt;&lt;P&gt;PORT_SetPinSelect(kPORT_FTM2CH3, kPORT_FTM2_CH3_PTG5);&lt;/P&gt;&lt;P&gt;When I debug everything is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to use FTM1 and Channel 1. Since I want to use FTM1 hence I am using FTM1_IRQn. Like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BOARD_FTM_BASEADDR FTM1&lt;BR /&gt;#define BOARD_FTM_CHANNEL kFTM_Chnl_1&lt;BR /&gt;#define FTM_INTERRUPT_NUMBER FTM1_IRQn&lt;BR /&gt;#define FTM_LED_HANDLER FTM1_IRQHandler&lt;BR /&gt;#define FTM_CHANNEL_INTERRUPT_ENABLE kFTM_Chnl1InterruptEnable&lt;BR /&gt;#define FTM_CHANNEL_FLAG kFTM_Chnl1Flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I changed the pin in&amp;nbsp;&lt;SPAN&gt;BOARD_InitPins();&amp;nbsp; function as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PORT_SetPinSelect(kPORT_FTM1CH1, kPORT_FTM1_CH1_PTC5);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I debug this code my program is hanging. When I made step by step debug I see that when execution goes to the&amp;nbsp;&amp;nbsp;FTM_Init(BOARD_FTM_BASEADDR, &amp;amp;ftmInfo); function, when execution goes to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;base-&amp;gt;MODE = FTM_MODE_FAULTM(config-&amp;gt;faultMode) | FTM_MODE_FTMEN_MASK | FTM_MODE_WPDIS_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;program is hanging all the times.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I use FTM2 with channel 3 and FTM"_IRQn then it is fine. The problem is only when I use FTM1 and channel1 and FTM1_IRQn.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I should use FTM1 since my&amp;nbsp;prototype uses&amp;nbsp; PTC5 for PWM.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone tell me the problem here?. Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Mar 2020 15:27:35 GMT</pubDate>
    <dc:creator>mona</dc:creator>
    <dc:date>2020-03-23T15:27:35Z</dc:date>
    <item>
      <title>PWM with FTM1 and channel 1 : The program hangs. Works fine for FTM2 and channel 3</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PWM-with-FTM1-and-channel-1-The-program-hangs-Works-fine-for/m-p/1002064#M55906</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 am working with FRDM-KE06Z custom board. I have imported ftm_simple_pwm program in to my MCUXpresso IDE and started working on it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this code I see that they are using FTM2 and channel 3. And FTM2_IRQn. Like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BOARD_FTM_BASEADDR FTM2&lt;BR /&gt;#define BOARD_FTM_CHANNEL kFTM_Chnl_3&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define FTM_INTERRUPT_NUMBER FTM2_IRQn&lt;BR /&gt;#define FTM_LED_HANDLER FTM2_IRQHandler&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define FTM_CHANNEL_INTERRUPT_ENABLE kFTM_Chnl3InterruptEnable&lt;BR /&gt;#define FTM_CHANNEL_FLAG kFTM_Chnl3Flag&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define FTM_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_TimerClk)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the main function in the&amp;nbsp;&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;/P&gt;&lt;P&gt;inside&amp;nbsp;BOARD_InitPins(); function they are using corresponsding pin.&amp;nbsp;&lt;/P&gt;&lt;P&gt;PORT_SetPinSelect(kPORT_FTM2CH3, kPORT_FTM2_CH3_PTG5);&lt;/P&gt;&lt;P&gt;When I debug everything is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to use FTM1 and Channel 1. Since I want to use FTM1 hence I am using FTM1_IRQn. Like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BOARD_FTM_BASEADDR FTM1&lt;BR /&gt;#define BOARD_FTM_CHANNEL kFTM_Chnl_1&lt;BR /&gt;#define FTM_INTERRUPT_NUMBER FTM1_IRQn&lt;BR /&gt;#define FTM_LED_HANDLER FTM1_IRQHandler&lt;BR /&gt;#define FTM_CHANNEL_INTERRUPT_ENABLE kFTM_Chnl1InterruptEnable&lt;BR /&gt;#define FTM_CHANNEL_FLAG kFTM_Chnl1Flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I changed the pin in&amp;nbsp;&lt;SPAN&gt;BOARD_InitPins();&amp;nbsp; function as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PORT_SetPinSelect(kPORT_FTM1CH1, kPORT_FTM1_CH1_PTC5);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I debug this code my program is hanging. When I made step by step debug I see that when execution goes to the&amp;nbsp;&amp;nbsp;FTM_Init(BOARD_FTM_BASEADDR, &amp;amp;ftmInfo); function, when execution goes to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;base-&amp;gt;MODE = FTM_MODE_FAULTM(config-&amp;gt;faultMode) | FTM_MODE_FTMEN_MASK | FTM_MODE_WPDIS_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;program is hanging all the times.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I use FTM2 with channel 3 and FTM"_IRQn then it is fine. The problem is only when I use FTM1 and channel1 and FTM1_IRQn.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I should use FTM1 since my&amp;nbsp;prototype uses&amp;nbsp; PTC5 for PWM.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone tell me the problem here?. Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 15:27:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PWM-with-FTM1-and-channel-1-The-program-hangs-Works-fine-for/m-p/1002064#M55906</guid>
      <dc:creator>mona</dc:creator>
      <dc:date>2020-03-23T15:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: PWM with FTM1 and channel 1 : The program hangs. Works fine for FTM2 and channel 3</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PWM-with-FTM1-and-channel-1-The-program-hangs-Works-fine-for/m-p/1002065#M55907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohan, I hope you're doing well!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible for you to try replicating the issue on a FRDM-KE06Z development board? This is to make sure that the issue is not due to possible errors in the custom board and to better isolate the possible issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know of your findings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2020 17:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PWM-with-FTM1-and-channel-1-The-program-hangs-Works-fine-for/m-p/1002065#M55907</guid>
      <dc:creator>Sebastian_Del_Rio</dc:creator>
      <dc:date>2020-03-24T17:22:59Z</dc:date>
    </item>
  </channel>
</rss>

