<?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: NEW to LPC, please help ! - LPC 1769 basics  - any help appreciated !</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520469#M3655</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by LabRat on Tue Oct 07 21:37:14 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Jantje7600&lt;/STRONG&gt;&lt;BR /&gt;I know it is a lot but I would appreciate your help ! I really really searched a lot on the internet...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Start with a simple sample&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCOpen isn't including a PWM sample, so search this forum to find a sample from ex-sample writers&amp;nbsp; ;-) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;See #7 of &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpc1769-timer-question" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/forum/lpc1769-timer-question&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:43:19 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:43:19Z</dc:date>
    <item>
      <title>NEW to LPC, please help ! - LPC 1769 basics  - any help appreciated !</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520468#M3654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Jantje7600 on Tue Oct 07 12:14:23 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a LPC1769 microcontroller and I would like to use it for my DC-AC inverter (using PWM).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am a newbie, I have figured out how the blinky program works and a little bit more :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the internet I could not found any useful tutorial or book (I have read the user manual), many people on the internet say look at the examples. Well I did that but for me it is still not clear and the manual isn't a tutorial.&lt;/SPAN&gt;&lt;BR /&gt;&lt;I&gt;&lt;STRONG&gt;&lt;BR /&gt;Along the way I have marked my questions with a number.&lt;/STRONG&gt;&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please correct me if I'm wrong:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I want to select GPIO Port 2.0 I use the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Select P2.0 and use GPIO Port 2.0 function&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL4 |= ( (0&amp;lt;&amp;lt;0) | (0&amp;lt;&amp;lt;1) );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1)&amp;nbsp; so LPC_PINCON is &lt;/SPAN&gt;&lt;STRONG&gt;always&lt;/STRONG&gt;&lt;SPAN&gt; used when a pin needs to be selected ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //According to manual: FIODIR = Fast GPIO Port Direction control register. This register individually controls the direction of each port pin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Set pin P2.0 as output&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPIO2-&amp;gt;FIODIR = (1&amp;lt;&amp;lt;0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Okay, so when do I use FIODIR? Only when I have to declare the pin as an input or output?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Set pin P2.0 high&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_GPIO2-&amp;gt;FIOPIN |= (1&amp;lt;&amp;lt;0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) I have seen the following &amp;amp; = ~&amp;nbsp;&amp;nbsp;&amp;nbsp; so LPC_GPIO2-&amp;gt;FIOPIN &amp;amp;= ~(1&amp;lt;&amp;lt;0); does this mean "disable" ? When is this used?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now the real part comes. I want to use PWM (in combination with a driver IC) to drive my MOSFETS. First I want to know how I can use the PWM functionality of the LPC1769 to drive only one MOSFET.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To set the frequency of the PWM signal I need to use the clock frequency of the microcontroller I believe...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4) So do I have to use PCLKSEL0 and PCLKSEL1 ? If yes, how can I set them (please show the code :p, I think it is one line) ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) For pin select I use LPC_PINCON and for pheripheral clock I use LPC_SC is this correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the manual it says:&amp;nbsp; "Peripheral clock: In the PCLKSEL0 register (Table 40), select PCLK_PWM1. " &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;6) Do I have to set it to 00 or 01 or 10 or 11? And why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So assume I set it like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SC-&amp;gt;PCLKSEL0 |= ((1 &amp;lt;&amp;lt; 12) | (1 &amp;lt;&amp;lt; 13));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_PINCON-&amp;gt;PINSEL4 |= ( (1 &amp;lt;&amp;lt; 0) | (0 &amp;lt;&amp;lt; 1) ); //select PWM 1.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_PINCON-&amp;gt;PINMODE4 |= ((0 &amp;lt;&amp;lt; 0) |(1 &amp;lt;&amp;lt; 1)); //Port 2 pin 0 control, this is somehow needed because of the pull-up/pull-down register which are both disabled&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;7) Have I missed something else? I just want to use a PWM to drive MOSFETS in order to drive my full bridge DC-AC inverter ( When I have finished this I will use a good Driver IC with bootstrapping for the inverter because the microcontroller cannot supply enough current to charge up the gate capacitance of the MOSFETS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know it is a lot but I would appreciate your help ! I really really searched a lot on the internet... Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:43:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520468#M3654</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: NEW to LPC, please help ! - LPC 1769 basics  - any help appreciated !</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520469#M3655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by LabRat on Tue Oct 07 21:37:14 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Jantje7600&lt;/STRONG&gt;&lt;BR /&gt;I know it is a lot but I would appreciate your help ! I really really searched a lot on the internet...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Start with a simple sample&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCOpen isn't including a PWM sample, so search this forum to find a sample from ex-sample writers&amp;nbsp; ;-) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;See #7 of &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpc1769-timer-question" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/forum/lpc1769-timer-question&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:43:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520469#M3655</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: NEW to LPC, please help ! - LPC 1769 basics  - any help appreciated !</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520470#M3656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Pacman on Wed Oct 08 02:35:56 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You've chosen an excellent microcontroller. &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1 + 2: Just set these when you initialize (that's when your program starts up, so normally it's once only).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3: To manually set pin 2.0 to high (eg. 3.3 volt on it), use &lt;/SPAN&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;LPC_GPIO2-&amp;gt;FIOPIN |= (1 &amp;lt;&amp;lt; 0);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;To manually set pin 2.0 to low (eg 0 volt on it), use &lt;/SPAN&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;LPC_GPIO2-&amp;gt;FIOPIN &amp;amp;= ~(1 &amp;lt;&amp;lt; 0);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4+5+6: Use a library, such as LPCOpen. It does all this stuff for you, and you'll have less headache. &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;7: You should know, that you will always need to enable clock+power for each peripheral you are using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By default, most of these are turned off. Eg. if you need to use a timer, you should turn it on yourself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is also done by the library, when you call init_*, but I want to mention it, in case you're stuck some day and have problems finding out why a peripheral doesn't want to start.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;8: (well, had to make one up). Explore! Use small steps. When you are unsure about something, make a new project and test out your theories until you've found out how things needs to be done, then apply the result to your main project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... Some details you might want to know if you're new ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;amp; means bitwise AND. All the specified bits are kept, the bits that are not specified will be cleared.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;~ means bitwise NOT. It inverts all the bits in the remaining part of the expression.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| means bitwise OR. all the specified bits are set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The line...&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;LPC_GPIO2-&amp;gt;FIOPIN |= (1 &amp;lt;&amp;lt; 0);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;...could be written as ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;LPC_GPIO2-&amp;gt;FIOPIN = LPC_GPIO2-&amp;gt;FIOPIN | (1 &amp;lt;&amp;lt; 0);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;... it is &lt;/SPAN&gt;&lt;I&gt;&lt;STRONG&gt;exactly&lt;/STRONG&gt;&lt;/I&gt;&lt;SPAN&gt; the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-So you could do the same thing with the other line...&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;LPC_GPIO2-&amp;gt;FIOPIN = LPC_GPIO2-&amp;gt;FIOPIN &amp;amp; ~(1 &amp;lt;&amp;lt; 0);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;... There is no difference, except from that it might be easier to understand for newcomers what is going on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:43:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520470#M3656</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: NEW to LPC, please help ! - LPC 1769 basics  - any help appreciated !</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520471#M3657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jomonthomasnew on Mon Oct 19 06:23:27 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You can find some good tutorials from the below link.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.techmasterplus.com%2Ftutorials.php" rel="nofollow" target="_blank"&gt;http://www.techmasterplus.com/tutorials.php&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1769 programming is not much different from other controllers like LPC14xx. You can follow that tutorials also.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:43:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NEW-to-LPC-please-help-LPC-1769-basics-any-help-appreciated/m-p/520471#M3657</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:43:20Z</dc:date>
    </item>
  </channel>
</rss>

