<?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: Modify PWM range, from 0 to 100 to 0 to 255 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1759392#M54727</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I come to know your question.&lt;/P&gt;
&lt;P&gt;First of all, the code you modified is correct I suppose.&lt;/P&gt;
&lt;P&gt;But the actual PWM resolution is dependent on the PWM module driving clock frequency as well as the PWM signal frequency.&lt;/P&gt;
&lt;P&gt;For example,for LPC54018, the PWM module driving clock is 180MHz, if your required PWM signal frequency is 180Hz, the PWM period register is 180MHz/180Hz=1000_000, of course, you can get 255 step resolution, the one step is 1000_0000/255=3921.&lt;/P&gt;
&lt;P&gt;But if your required PWM signal frequency is 1MHz, the PWM period register is 180MHz/1MHz=18, of course, the duty cycle can be from only 0 to 17, you can not get 255 step resolution.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
    <pubDate>Sun, 19 Nov 2023 13:21:32 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2023-11-19T13:21:32Z</dc:date>
    <item>
      <title>Modify PWM range, from 0 to 100 to 0 to 255</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1755757#M54681</link>
      <description>&lt;P&gt;I wanted to know if I can modify the pulse_period interval just by modifying the parameter variable map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pulse.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/249436iDB60A108DBBB49D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pulse.png" alt="pulse.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the PWM update function, as shown in the figure, there is a map of variables tending to 100%, can I change it to this value of 255 and only with that change the PWM resolution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if not this way, how could I change the PWM resolution of this controller?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Fri, 10 Nov 2023 20:07:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1755757#M54681</guid>
      <dc:creator>RodrigoEngComp</dc:creator>
      <dc:date>2023-11-10T20:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Modify PWM range, from 0 to 100 to 0 to 255</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1755972#M54689</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The PWM resolution is ONLY dependent on the PWM module driving clock frequency, you do not say the LPC part number you are using, I give an example based on LPC5516.&lt;/P&gt;
&lt;P&gt;This is CTimer driving clock source, if you select main_clk which is 150MHz at most fro lpc5516, the ctimer PWM signal will have the best the resolution, you can see the PWM as a divider.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1699843804705.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/249498i4772A28308AA7180/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1699843804705.png" alt="xiangjun_rong_0-1699843804705.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you do not use LPC5516, pls check the SYSCON chapter in the UM.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 02:53:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1755972#M54689</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-11-13T02:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Modify PWM range, from 0 to 100 to 0 to 255</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1756458#M54695</link>
      <description>&lt;P&gt;I am using an LPC54S018, allowing a PWM from 0 to 100% of the duty cycle. But I wanted to increase this resolution and expand this duty cycle value between 0 and 255,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you enlighten me for this part number?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 18:51:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1756458#M54695</guid>
      <dc:creator>RodrigoEngComp</dc:creator>
      <dc:date>2023-11-13T18:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Modify PWM range, from 0 to 100 to 0 to 255</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1759392#M54727</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I come to know your question.&lt;/P&gt;
&lt;P&gt;First of all, the code you modified is correct I suppose.&lt;/P&gt;
&lt;P&gt;But the actual PWM resolution is dependent on the PWM module driving clock frequency as well as the PWM signal frequency.&lt;/P&gt;
&lt;P&gt;For example,for LPC54018, the PWM module driving clock is 180MHz, if your required PWM signal frequency is 180Hz, the PWM period register is 180MHz/180Hz=1000_000, of course, you can get 255 step resolution, the one step is 1000_0000/255=3921.&lt;/P&gt;
&lt;P&gt;But if your required PWM signal frequency is 1MHz, the PWM period register is 180MHz/1MHz=18, of course, the duty cycle can be from only 0 to 17, you can not get 255 step resolution.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2023 13:21:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Modify-PWM-range-from-0-to-100-to-0-to-255/m-p/1759392#M54727</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-11-19T13:21:32Z</dc:date>
    </item>
  </channel>
</rss>

