<?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 Is 48MHz PWM possible using SCT on LPC4357@204MHz? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Is-48MHz-PWM-possible-using-SCT-on-LPC4357-204MHz/m-p/779547#M31361</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently struggling with the SCT, which I need to use for PWM generation.&lt;/P&gt;&lt;P&gt;I tried the LPCopen function:&lt;/P&gt;&lt;P&gt;&lt;A title="Sets the frequency of the generated PWM wave."&gt;Chip_SCTPWM_SetRate&lt;/A&gt;(&lt;A title="State Configurable Timer register block structure."&gt;LPC_SCT_T&lt;/A&gt; *pSCT, uint32_t freq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It calculates a rate and writes it to the match reload register 0:&lt;/P&gt;&lt;P&gt;rate = &lt;A title="Returns a peripheral clock rate."&gt;Chip_Clock_GetRate&lt;/A&gt;(&lt;A&gt;CLK_MX_SCT&lt;/A&gt;) / freq;&lt;/P&gt;&lt;P&gt;&lt;A title="Set unified match reload count value in State Configurable Timer."&gt;Chip_SCT_SetMatchReload&lt;/A&gt;(pSCT, &lt;A&gt;SCT_MATCH_0&lt;/A&gt;, rate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chip clock is 204MHz and the requested PWM frequency (freq) is 48MHz.&lt;/P&gt;&lt;P&gt;204 / 48 = 4.25&lt;/P&gt;&lt;P&gt;The decimals are of course lost and I end up with a frequency of 40.8MHz (204 / (4+1))&lt;/P&gt;&lt;P&gt;The next step I can reach using this function is 51MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to get 48MHz output frequency using directly the SCT registers, without LPCopen?&lt;/P&gt;&lt;P&gt;Thanks for any hint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;The frequencies are not multiples, the clock can only be divided, there is only one internal clock source for SCT.&lt;BR /&gt;It's not possible to generate PWM @ 48 MHz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2018 13:25:24 GMT</pubDate>
    <dc:creator>quex</dc:creator>
    <dc:date>2018-06-13T13:25:24Z</dc:date>
    <item>
      <title>Is 48MHz PWM possible using SCT on LPC4357@204MHz?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Is-48MHz-PWM-possible-using-SCT-on-LPC4357-204MHz/m-p/779547#M31361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently struggling with the SCT, which I need to use for PWM generation.&lt;/P&gt;&lt;P&gt;I tried the LPCopen function:&lt;/P&gt;&lt;P&gt;&lt;A title="Sets the frequency of the generated PWM wave."&gt;Chip_SCTPWM_SetRate&lt;/A&gt;(&lt;A title="State Configurable Timer register block structure."&gt;LPC_SCT_T&lt;/A&gt; *pSCT, uint32_t freq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It calculates a rate and writes it to the match reload register 0:&lt;/P&gt;&lt;P&gt;rate = &lt;A title="Returns a peripheral clock rate."&gt;Chip_Clock_GetRate&lt;/A&gt;(&lt;A&gt;CLK_MX_SCT&lt;/A&gt;) / freq;&lt;/P&gt;&lt;P&gt;&lt;A title="Set unified match reload count value in State Configurable Timer."&gt;Chip_SCT_SetMatchReload&lt;/A&gt;(pSCT, &lt;A&gt;SCT_MATCH_0&lt;/A&gt;, rate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chip clock is 204MHz and the requested PWM frequency (freq) is 48MHz.&lt;/P&gt;&lt;P&gt;204 / 48 = 4.25&lt;/P&gt;&lt;P&gt;The decimals are of course lost and I end up with a frequency of 40.8MHz (204 / (4+1))&lt;/P&gt;&lt;P&gt;The next step I can reach using this function is 51MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to get 48MHz output frequency using directly the SCT registers, without LPCopen?&lt;/P&gt;&lt;P&gt;Thanks for any hint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;The frequencies are not multiples, the clock can only be divided, there is only one internal clock source for SCT.&lt;BR /&gt;It's not possible to generate PWM @ 48 MHz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 13:25:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Is-48MHz-PWM-possible-using-SCT-on-LPC4357-204MHz/m-p/779547#M31361</guid>
      <dc:creator>quex</dc:creator>
      <dc:date>2018-06-13T13:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is 48MHz PWM possible using SCT on LPC4357@204MHz?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Is-48MHz-PWM-possible-using-SCT-on-LPC4357-204MHz/m-p/779548#M31362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi quex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yes, just as your edit content.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Because 204/48=4.25, it not multiples, then you can't generate the 48Mhz directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you want to generate the 48Mhz, I think you need to change the SCT module clock, which can be muliple by 48Mhz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2018 04:33:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Is-48MHz-PWM-possible-using-SCT-on-LPC4357-204MHz/m-p/779548#M31362</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-06-15T04:33:17Z</dc:date>
    </item>
  </channel>
</rss>

