<?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: GPIO_PortSet &amp;amp; GPIO_PortClear Behaviour in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-PortSet-amp-GPIO-PortClear-Behaviour/m-p/1949338#M56816</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/240210"&gt;@scruffmeister&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This "inverted logic" is due to the physical connection of the LED on the LPCXpresso824MAX board:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EdwinHz_0-1725658025431.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/297687iA68207B1115F4D92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EdwinHz_0-1725658025431.png" alt="EdwinHz_0-1725658025431.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The LEDs require&amp;nbsp;&lt;SPAN&gt;anode to be high and the cathode to be low to turn ON.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the schematic we can see that the anodes are already connected to 3.3V, while the cathodes are connected to the GPIO pins.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore, if we set the GPIO pins to HIGH, there will be no potential difference between anode and cathode and the LED will remain OFF. If the GPIO are cleared to LOW, the potential difference will be present, and the LED will turn ON.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this clears things up.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR,&lt;BR /&gt;Edwin.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2024 21:33:03 GMT</pubDate>
    <dc:creator>EdwinHz</dc:creator>
    <dc:date>2024-09-06T21:33:03Z</dc:date>
    <item>
      <title>GPIO_PortSet &amp; GPIO_PortClear Behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-PortSet-amp-GPIO-PortClear-Behaviour/m-p/1949130#M56815</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;board.h&lt;/STRONG&gt;&amp;nbsp;file in the&amp;nbsp;&lt;STRONG&gt;led_blinky&lt;/STRONG&gt; SDK example for the LPC824 uses 'GPIO_PortClear' to turn an output port &lt;STRONG&gt;HIGH&lt;/STRONG&gt;, and 'GPIO_PortSet' to turn an output port &lt;STRONG&gt;LOW&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I have been trying to understand why 'clearing' results in a HIGH output (when it feels like it should result in LOW to me), but have not been able to find my answer in the processor manual. I know I am missing something, please could someone explain?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#define LED_RED_ON()                                             \                 
    GPIO_PortClear(BOARD_LED_RED_GPIO, BOARD_LED_RED_GPIO_PORT,  \                  
                   1U &amp;lt;&amp;lt; BOARD_LED_RED_GPIO_PIN)                 
                                                
#define LED_RED_OFF()                                            \                
    GPIO_PortSet(BOARD_LED_RED_GPIO, BOARD_LED_RED_GPIO_PORT,    \
                 1U &amp;lt;&amp;lt; BOARD_LED_RED_GPIO_PIN)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 14:34:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-PortSet-amp-GPIO-PortClear-Behaviour/m-p/1949130#M56815</guid>
      <dc:creator>scruffmeister</dc:creator>
      <dc:date>2024-09-06T14:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO_PortSet &amp; GPIO_PortClear Behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-PortSet-amp-GPIO-PortClear-Behaviour/m-p/1949338#M56816</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/240210"&gt;@scruffmeister&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This "inverted logic" is due to the physical connection of the LED on the LPCXpresso824MAX board:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EdwinHz_0-1725658025431.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/297687iA68207B1115F4D92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EdwinHz_0-1725658025431.png" alt="EdwinHz_0-1725658025431.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The LEDs require&amp;nbsp;&lt;SPAN&gt;anode to be high and the cathode to be low to turn ON.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the schematic we can see that the anodes are already connected to 3.3V, while the cathodes are connected to the GPIO pins.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore, if we set the GPIO pins to HIGH, there will be no potential difference between anode and cathode and the LED will remain OFF. If the GPIO are cleared to LOW, the potential difference will be present, and the LED will turn ON.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this clears things up.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR,&lt;BR /&gt;Edwin.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 21:33:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-PortSet-amp-GPIO-PortClear-Behaviour/m-p/1949338#M56816</guid>
      <dc:creator>EdwinHz</dc:creator>
      <dc:date>2024-09-06T21:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO_PortSet &amp; GPIO_PortClear Behaviour</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-PortSet-amp-GPIO-PortClear-Behaviour/m-p/1949426#M56817</link>
      <description>&lt;P&gt;Thank you, that makes perfect sense.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 15:48:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-PortSet-amp-GPIO-PortClear-Behaviour/m-p/1949426#M56817</guid>
      <dc:creator>scruffmeister</dc:creator>
      <dc:date>2024-09-07T15:48:46Z</dc:date>
    </item>
  </channel>
</rss>

