<?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: Noob help - Basics (input and output) in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549383#M10955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Sat Jan 17 02:00:43 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: LukeHill2015&lt;/STRONG&gt;&lt;BR /&gt;The LED is on, i do not understand why this is as i thought FIODIR just configures the pin. &lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;User manual 10360 is describing this registers: &lt;/SPAN&gt;&lt;BR /&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.nxp.com%2Fdocuments%2Fuser_manual%2FUM10360.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.nxp.com/documents/user_manual/UM10360.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DIR is just changing the direction, not the level of the pin&amp;nbsp; :(( &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Default pin setup (after Reset) is input and pull-up (see PINMODE registers)&amp;nbsp; &lt;SPAN class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;&lt;LI-EMOJI id="lia_face-with-open-mouth" title=":face_with_open_mouth:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So your input is pulled high and you switch this pin to output -&amp;gt; out / high -&amp;gt;&amp;nbsp; LED is on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you set PINMODE of this pin to pull-down before you change it to output you'll get out / low -&amp;gt; LED is off.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;LPC_PINCON-&amp;gt;PINMODE0 |= (3 &amp;lt;&amp;lt; 12); //pulldown&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: Peripheral view of debugger is helpful to change this settings and watch the result&amp;nbsp; &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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:04:38 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:04:38Z</dc:date>
    <item>
      <title>Noob help - Basics (input and output)</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549382#M10954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by LukeHill2015 on Fri Jan 16 16:40:20 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ive been given a LPCExpresso 1769 board along with an experiment board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far i can do light sequences with little knowledge how it is actually working. Ive been looking for help and documentation/tutorials for a while not but cant find anything usefull.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code to turn on only 1 LED.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= (~(3 &amp;lt;&amp;lt; 12));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_GPIO0-&amp;gt;FIODIR |= (1 &amp;lt;&amp;lt; 6);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_GPIO0-&amp;gt;FIOSET = (1 &amp;lt;&amp;lt; 6); //turn on&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_GPIO0-&amp;gt;FIOCLR = (1 &amp;lt;&amp;lt; 6); // turn off&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The confusion i have is that if i take out the FIOSET and FIOCLR line to just have&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= (~(3 &amp;lt;&amp;lt; 12));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_GPIO0-&amp;gt;FIODIR |= (1 &amp;lt;&amp;lt; 6);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The LED is on, i do not understand why this is as i thought FIODIR just configures the pin. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What if i wanted to configure the LED for output until a button is pressed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be much appreciated, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:04:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549382#M10954</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Noob help - Basics (input and output)</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549383#M10955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Sat Jan 17 02:00:43 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: LukeHill2015&lt;/STRONG&gt;&lt;BR /&gt;The LED is on, i do not understand why this is as i thought FIODIR just configures the pin. &lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;User manual 10360 is describing this registers: &lt;/SPAN&gt;&lt;BR /&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.nxp.com%2Fdocuments%2Fuser_manual%2FUM10360.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.nxp.com/documents/user_manual/UM10360.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DIR is just changing the direction, not the level of the pin&amp;nbsp; :(( &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Default pin setup (after Reset) is input and pull-up (see PINMODE registers)&amp;nbsp; &lt;SPAN class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;&lt;LI-EMOJI id="lia_face-with-open-mouth" title=":face_with_open_mouth:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So your input is pulled high and you switch this pin to output -&amp;gt; out / high -&amp;gt;&amp;nbsp; LED is on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you set PINMODE of this pin to pull-down before you change it to output you'll get out / low -&amp;gt; LED is off.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;LPC_PINCON-&amp;gt;PINMODE0 |= (3 &amp;lt;&amp;lt; 12); //pulldown&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: Peripheral view of debugger is helpful to change this settings and watch the result&amp;nbsp; &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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:04:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549383#M10955</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Noob help - Basics (input and output)</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549384#M10956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by LukeHill2015 on Sat Jan 17 04:40:30 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help but that didn't do anything for me :/ &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_PINCON-&amp;gt;PINMODE0 |= (1 &amp;lt;&amp;lt; 12); //pulldown&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= (~(3 &amp;lt;&amp;lt; 12));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPIO0-&amp;gt;FIODIR |= (1 &amp;lt;&amp;lt; 6);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volatile static uint32_t i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPIO0-&amp;gt;FIOSET = (1 &amp;lt;&amp;lt; 6); // Turn LED1 on&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is what i have at the moment, FIOSET is actually turning the LED off. Which is just confusing, and FIOCLR will turn it on.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:04:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549384#M10956</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Noob help - Basics (input and output)</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549385#M10957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Sat Jan 17 05:06:10 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: LukeHill2015&lt;/STRONG&gt;&lt;BR /&gt;That is what i have at the moment, FIOSET is actually turning the LED off. Which is just confusing, and FIOCLR will turn it on.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you are obviously switching the cathode of your LED&amp;nbsp; :D &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So pin low is LED ON and pin high is LED OFF...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Schematic of your board should help you to riddle this behaviour&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:04:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Noob-help-Basics-input-and-output/m-p/549385#M10957</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:04:39Z</dc:date>
    </item>
  </channel>
</rss>

