<?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中的主题 Problem porting tpm_simple_pwm.c functionality over to my application</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-porting-tpm-simple-pwm-c-functionality-over-to-my/m-p/1542831#M64205</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am using an FRMD-K32L2B3 board and the latest&amp;nbsp;MCUXpresso IDE v11.6.0 [Build 8187] [2022-07-13] IDE.&lt;/P&gt;&lt;P&gt;I have a fairly simple C based application I've developed using the UARTs and some GPIO on that board, it works fine.&amp;nbsp; However I wanted to add PWM output to one of the GPIOs.&amp;nbsp; The sample project&amp;nbsp;tpm_simple_pwm.c works fine and generates the expected PWM output signal on the green LED output on the board.&amp;nbsp; When I try to cut and paste that exact file into my custom project and run it, I get no PWM output on the pin however, just a constant voltage of about 1.5V.&lt;/P&gt;&lt;P&gt;Are there any additional settings I should be carrying over from the tpm_simple_pwc project into my custom project to get PWM output working?&lt;/P&gt;&lt;P&gt;Also if it has any effect, in my custom project I had to change a few symbol defines to get floating point printf working, the full set of defined symbols in my custom project is:&lt;/P&gt;&lt;P&gt;-std=gnu99 -D__REDLIB__ -DPRINTF_ADVANCED_ENABLE=1 -DCPU_K32L2B31VLH0A -DCPU_K32L2B31VLH0A_cm0plus -DFRDM_K32L2B -DFREEDOM -DMCUXPRESSO_SDK -DSDK_DEBUGCONSOLE=1 -DPRINTF_FLOAT_ENABLE=1 -D__MCUXPRESSO -D__USE_CMSIS -DDEBUG -I"C:\project\source" -I"C:\project\utilities" -I"C:\project\drivers" -I"C:\project\device" -I"C:\project\component\uart" -I"C:\project\component\lists" -I"C:\project\CMSIS" -I"C:\project\board" -I"C:\project\frdmk32l2b\driver_examples\gpio\led_output" -O0 -fno-common -g3 -c -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -fmerge-constants -fmacro-prefix-map="$(&amp;lt;D)/"= -mcpu=cortex-m0plus -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2022 16:46:01 GMT</pubDate>
    <dc:creator>smachin_kinematics</dc:creator>
    <dc:date>2022-10-24T16:46:01Z</dc:date>
    <item>
      <title>Problem porting tpm_simple_pwm.c functionality over to my application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-porting-tpm-simple-pwm-c-functionality-over-to-my/m-p/1542831#M64205</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am using an FRMD-K32L2B3 board and the latest&amp;nbsp;MCUXpresso IDE v11.6.0 [Build 8187] [2022-07-13] IDE.&lt;/P&gt;&lt;P&gt;I have a fairly simple C based application I've developed using the UARTs and some GPIO on that board, it works fine.&amp;nbsp; However I wanted to add PWM output to one of the GPIOs.&amp;nbsp; The sample project&amp;nbsp;tpm_simple_pwm.c works fine and generates the expected PWM output signal on the green LED output on the board.&amp;nbsp; When I try to cut and paste that exact file into my custom project and run it, I get no PWM output on the pin however, just a constant voltage of about 1.5V.&lt;/P&gt;&lt;P&gt;Are there any additional settings I should be carrying over from the tpm_simple_pwc project into my custom project to get PWM output working?&lt;/P&gt;&lt;P&gt;Also if it has any effect, in my custom project I had to change a few symbol defines to get floating point printf working, the full set of defined symbols in my custom project is:&lt;/P&gt;&lt;P&gt;-std=gnu99 -D__REDLIB__ -DPRINTF_ADVANCED_ENABLE=1 -DCPU_K32L2B31VLH0A -DCPU_K32L2B31VLH0A_cm0plus -DFRDM_K32L2B -DFREEDOM -DMCUXPRESSO_SDK -DSDK_DEBUGCONSOLE=1 -DPRINTF_FLOAT_ENABLE=1 -D__MCUXPRESSO -D__USE_CMSIS -DDEBUG -I"C:\project\source" -I"C:\project\utilities" -I"C:\project\drivers" -I"C:\project\device" -I"C:\project\component\uart" -I"C:\project\component\lists" -I"C:\project\CMSIS" -I"C:\project\board" -I"C:\project\frdmk32l2b\driver_examples\gpio\led_output" -O0 -fno-common -g3 -c -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -fmerge-constants -fmacro-prefix-map="$(&amp;lt;D)/"= -mcpu=cortex-m0plus -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 16:46:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-porting-tpm-simple-pwm-c-functionality-over-to-my/m-p/1542831#M64205</guid>
      <dc:creator>smachin_kinematics</dc:creator>
      <dc:date>2022-10-24T16:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem porting tpm_simple_pwm.c functionality over to my application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-porting-tpm-simple-pwm-c-functionality-over-to-my/m-p/1543058#M64208</link>
      <description>&lt;P&gt;Hi&amp;nbsp;smachin_kinematics,&lt;/P&gt;
&lt;P&gt;Can you tell me which pin you need to output the PWM waveform on?&lt;BR /&gt;Besides tpm_simple_pwm.c, you may also need pin_mux.c.h and clock_config.c.h generated by &lt;STRONG&gt;Pins&lt;/STRONG&gt; Tool and &lt;STRONG&gt;Clocks&lt;/STRONG&gt; Tool&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pin_mux and clock_config.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/197956i43CB17446AAB0E56/image-size/large?v=v2&amp;amp;px=999" role="button" title="pin_mux and clock_config.png" alt="pin_mux and clock_config.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pins Tool.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/197957i98A85B8C48A9C130/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pins Tool.png" alt="Pins Tool.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you use your&amp;nbsp;&lt;STRONG&gt;MCUXpresso Config Tools&lt;/STRONG&gt; in your project, then no need to copy them.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 03:32:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-porting-tpm-simple-pwm-c-functionality-over-to-my/m-p/1543058#M64208</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-10-25T03:32:40Z</dc:date>
    </item>
  </channel>
</rss>

