<?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>LPC Microcontrollers中的主题 Re: PWM configuration</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1975282#M57078</link>
    <description>&lt;P&gt;Hey! thank you for the reply!&lt;BR /&gt;&lt;BR /&gt;I still don't understand quite though. I looked thorugh the example but i'm still not sure how to look up how to write to the registers on my specific EVK. If i try to use the example you linked, there are still some uninitiated variables such as EVENT and SCT_Type. It may be a stupud question but do i need to initiate these variables in some way, or am i using the wrong name in the case of my EVK?&amp;nbsp;&lt;BR /&gt;I'm having a lot of errors and i don't know what i'm supposed to do, maybe you can have a quick look and see what i'm doing wrong? how do i use the example you sent and adapt it to the LPCxpresso55S69 EVK?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2024 14:54:51 GMT</pubDate>
    <dc:creator>scoottroop</dc:creator>
    <dc:date>2024-10-16T14:54:51Z</dc:date>
    <item>
      <title>PWM configuration</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1974592#M57064</link>
      <description>&lt;P&gt;Hello everyone! I'm having some trouble with how to configure my PWM signal.&lt;/P&gt;&lt;P&gt;I have the LPCxpresso55s69 EVK.&lt;/P&gt;&lt;P&gt;Current state: Currently my program uses a few outputs and updates, outputting a PWM signal according to a calculated duty cycle, + a directly inverted signal.&amp;nbsp; Currently I am using the default PWM configuration as seen in the&amp;nbsp; "sctimer_update_dutycycle" example. The next step is to add two more signals, same as the first two I have created but having a slight dead time (The end goal is a full bridge configuration).&amp;nbsp;&lt;BR /&gt;I've therefore tried to configure the "sctimer_update_dutycycle" to learn how to do this but I'm stuck. I've tried looking in the "AN11538", but it made me a bit confused, so my (probably dumb) questions are: Should I do as in the manual and code the specific registers/bits or is there an easier way using the libraries. I'm currently using the SCtimer library, as in the examples. Am I missing some other important libraries?&lt;BR /&gt;&lt;BR /&gt;Is there any way to make the code in the "AN11538" work on the LPC55S69, it would make it a lot easier for me to understand the whole concept if I could follow those examples.&lt;BR /&gt;&lt;BR /&gt;I understand that I have to use different event and match registers. Again, I'm wondering if there are any libraries for this instead of coding it by hand as in the AN11538 manual. I can't seem to find it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Finally I have tried to just configure the PWM myself without using the default. When I try to use anything but the unified counter the program crashes, why? For dead time control I guess I need two, low counters just as in the example instead of the 32 bit counter.&lt;BR /&gt;An example of what I tested to configure is in the notepad I included, nothing else is altered so it should work to just copy the code from there.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry for the probably confusing questions!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 20:22:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1974592#M57064</guid>
      <dc:creator>scoottroop</dc:creator>
      <dc:date>2024-10-15T20:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: PWM configuration</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1975016#M57072</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;ON my opinion, as you want to generate complementary PWM signals with SCTimer/PWM module, I suggest you write SCTimer/PWM register directly based on AN11538.pdf, which has the code, writing register is direct and straightforward.&lt;/P&gt;
&lt;P&gt;calling the SDK driver is complex.&lt;/P&gt;
&lt;P&gt;Pls refer to the community ticket for writing the SCTimer register.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/Generating-phase-shift-PWM-signal-with-SCTimer-PWM-module/ta-p/1102461" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/Generating-phase-shift-PWM-signal-with-SCTimer-PWM-module/ta-p/1102461&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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>Wed, 16 Oct 2024 09:01:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1975016#M57072</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-10-16T09:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: PWM configuration</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1975282#M57078</link>
      <description>&lt;P&gt;Hey! thank you for the reply!&lt;BR /&gt;&lt;BR /&gt;I still don't understand quite though. I looked thorugh the example but i'm still not sure how to look up how to write to the registers on my specific EVK. If i try to use the example you linked, there are still some uninitiated variables such as EVENT and SCT_Type. It may be a stupud question but do i need to initiate these variables in some way, or am i using the wrong name in the case of my EVK?&amp;nbsp;&lt;BR /&gt;I'm having a lot of errors and i don't know what i'm supposed to do, maybe you can have a quick look and see what i'm doing wrong? how do i use the example you sent and adapt it to the LPCxpresso55S69 EVK?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 14:54:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1975282#M57078</guid>
      <dc:creator>scoottroop</dc:creator>
      <dc:date>2024-10-16T14:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: PWM configuration</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1975666#M57087</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Regarding the error of compilation, Pls refer to the lpc55s69_cm33_core0.h for the register architecture.&lt;/P&gt;
&lt;P&gt;I have changed part of the code, it can pass the compilation.&lt;/P&gt;
&lt;P&gt;The following code can pass the compilation.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="background-color: #ffffff; padding: 0px 0px 0px 2px;"&gt;
&lt;DIV style="color: #000000; background-color: #ffffff; font-family: 'Consolas'; font-size: 10pt; white-space: pre;"&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;void&lt;/SPAN&gt; &lt;SPAN&gt;SCT0_PWM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;void&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SYSCON-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;AHBCLKCTRLX&lt;/SPAN&gt;&lt;SPAN&gt;[1]|=(1&amp;lt;&amp;lt;2); &lt;/SPAN&gt;&lt;SPAN&gt;//SET SCT0 bit&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//configure the SCT clock source&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SYSCON-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;SCTCLKSEL&lt;/SPAN&gt;&lt;SPAN&gt;=0; &lt;/SPAN&gt;&lt;SPAN&gt;//main clock is the SCT driving clock&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;CONFIG&lt;/SPAN&gt;&lt;SPAN&gt; = (1 &amp;lt;&amp;lt; 0) | (1 &amp;lt;&amp;lt; 17); &lt;/SPAN&gt;&lt;SPAN&gt;// unified 32-bit timer, auto limit&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;MATCHREL&lt;/SPAN&gt;&lt;SPAN&gt;[0] = SystemCoreClock/100; &lt;/SPAN&gt;&lt;SPAN&gt;// match 0 @ 100 Hz = 10 &lt;/SPAN&gt;&lt;SPAN&gt;msec&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;EV&lt;/SPAN&gt;&lt;SPAN&gt;[0].&lt;/SPAN&gt;&lt;SPAN&gt;STATE&lt;/SPAN&gt;&lt;SPAN&gt; = 0xFFFFFFFF; &lt;/SPAN&gt;&lt;SPAN&gt;// event 0 happens in all states&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//set event1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;MATCHREL&lt;/SPAN&gt;&lt;SPAN&gt;[1]=0x00;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;EV&lt;/SPAN&gt;&lt;SPAN&gt;[1].&lt;/SPAN&gt;&lt;SPAN&gt;STATE&lt;/SPAN&gt;&lt;SPAN&gt; = 0xFFFFFFFF; &lt;/SPAN&gt;&lt;SPAN&gt;// event 1 happens in all states&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;EV&lt;/SPAN&gt;&lt;SPAN&gt;[1].&lt;/SPAN&gt;&lt;SPAN&gt;CTRL&lt;/SPAN&gt;&lt;SPAN&gt; = (1 &amp;lt;&amp;lt; 12)|(1&amp;lt;&amp;lt;0); &lt;/SPAN&gt;&lt;SPAN&gt;// match 1 condition only&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//PWM output1 signal&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;OUT&lt;/SPAN&gt;&lt;SPAN&gt;[1].&lt;/SPAN&gt;&lt;SPAN&gt;SET&lt;/SPAN&gt;&lt;SPAN&gt; = (1 &amp;lt;&amp;lt; 1); &lt;/SPAN&gt;&lt;SPAN&gt;// event 1 will set SCT1_OUT0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;OUT&lt;/SPAN&gt;&lt;SPAN&gt;[1].&lt;/SPAN&gt;&lt;SPAN&gt;CLR&lt;/SPAN&gt;&lt;SPAN&gt; = (1 &amp;lt;&amp;lt; 2); &lt;/SPAN&gt;&lt;SPAN&gt;// event 2 will clear SCT1_OUT0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;RES&lt;/SPAN&gt;&lt;SPAN&gt; |= (3 &amp;lt;&amp;lt; 2); &lt;/SPAN&gt;&lt;SPAN&gt;// output 0 toggles on conflict&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//PWM output2 signal&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;OUT&lt;/SPAN&gt;&lt;SPAN&gt;[2].&lt;/SPAN&gt;&lt;SPAN&gt;SET&lt;/SPAN&gt;&lt;SPAN&gt; = (1 &amp;lt;&amp;lt; 3); &lt;/SPAN&gt;&lt;SPAN&gt;// event 3 will set SCT1_OUT0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;OUT&lt;/SPAN&gt;&lt;SPAN&gt;[2].&lt;/SPAN&gt;&lt;SPAN&gt;CLR&lt;/SPAN&gt;&lt;SPAN&gt; = (1 &amp;lt;&amp;lt; 4); &lt;/SPAN&gt;&lt;SPAN&gt;// event 4 will clear SCT1_OUT0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;RES&lt;/SPAN&gt;&lt;SPAN&gt; = (3 &amp;lt;&amp;lt; 4); &lt;/SPAN&gt;&lt;SPAN&gt;// output 0 toggles on conflict&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//PWM start&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SCT0-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;CTRL&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;= ~(1 &amp;lt;&amp;lt; 2); &lt;/SPAN&gt;&lt;SPAN&gt;// &lt;/SPAN&gt;&lt;SPAN&gt;unhalt&lt;/SPAN&gt;&lt;SPAN&gt; by clearing bit 2 of the CTRL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//Pin initialization code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//PIO0_8 PIO0_8 FC2_RXD_SDA_MOSI SCT0_OUT1 CTIMER0_MAT3&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//PIO0_9 PIO0_9 FC2_TXD_SCL_MISO SCT0_OUT2 CTIMER3_CAP0 - FC3_CTS_SDA_SSEL0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;void&lt;/SPAN&gt; &lt;SPAN&gt;SCTimerPinInit&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;void&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//Enable the SCTimer clock&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; SYSCON-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;AHBCLKCTRLX&lt;/SPAN&gt;&lt;SPAN&gt;[0]|=(1&amp;lt;&amp;lt;13); &lt;/SPAN&gt;&lt;SPAN&gt;//set IOCON bit&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;//SCTimer pin assignment&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; IOCON-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;PIO&lt;/SPAN&gt;&lt;SPAN&gt;[0][18]=0x104;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; IOCON-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;PIO&lt;/SPAN&gt;&lt;SPAN&gt;[0][19]=0x104;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt; IOCON-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;PIO&lt;/SPAN&gt;&lt;SPAN&gt;[0][20]=0x104;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Oct 2024 03:30:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1975666#M57087</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-10-17T03:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: PWM configuration</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1978537#M57122</link>
      <description>&lt;P&gt;Hey again! thank you for the help so far! i've gotten a bit more into what I need to do, and I've tried altering an example from the AN11538,&amp;nbsp; example 20. I am able to compile, and I think I put all the correct registers (Changing&amp;nbsp; MATCHREL[x].L to MATCHREL_ACCESS16BIT[x].MATCHRELL etc, ALthough I'm unsure about the AHBCLKCTRL register).&amp;nbsp;&lt;BR /&gt;Even though it compiles, I do not get an output. Since I'm using the LPCCXpresso55S69, pin 1_4&amp;nbsp; is connected to the blue led of the EVK, which I have connected through the pin tool. It is connected to SCT0. It is constantly turned on to its fullest, I guess since I turned it on in the pin tool, but it does not answer to the code I write, and does not dim when using a low duty cycle!&lt;/P&gt;&lt;P&gt;I've both tried to change up the SCTimer clock frequency but nothing happens then either (Either for the example I'm sending nor the one you helped me translate!)&lt;BR /&gt;&lt;BR /&gt;So I'm wondering what do you think I do wrong? Do I still write to the wrong registers? am I missing some code in main or the SCT0 function? Do i need interuppts etc to continiously change the duty cycle in main? I'll include my current updated program as a file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for your patience and your help!&lt;BR /&gt;Best regards //&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 21:17:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-configuration/m-p/1978537#M57122</guid>
      <dc:creator>scoottroop</dc:creator>
      <dc:date>2024-10-21T21:17:34Z</dc:date>
    </item>
  </channel>
</rss>

