<?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:  problem in GPIO reading in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915476#M36570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Aravind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After checking your code, I dont see where the clock for the port is being initialized. Please try to enable to correct clock for the led and switch you are using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to see an example, you can use the LPCXpresso824max_gpio_led_ouput example which is available in the SDK.&lt;/P&gt;&lt;P&gt;This example uses a switch to toggle a led just as you are doing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can download the sdk &lt;A href="https://mcuxpresso.nxp.com/en/welcome"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jul 2019 14:49:25 GMT</pubDate>
    <dc:creator>Sabina_Bruce</dc:creator>
    <dc:date>2019-07-30T14:49:25Z</dc:date>
    <item>
      <title>problem in GPIO reading</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915473#M36567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I try to read a gipo pin status either 0 or 1 in digital form but when i try to read my assigned pin was not getting o/p&amp;nbsp;&lt;/P&gt;&lt;P&gt;please let me know the solution . in below i provided the code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Copyright (c) 2016, Freescale Semiconductor, Inc.&lt;BR /&gt; * Copyright 2016-2019 NXP&lt;BR /&gt; * All rights reserved.&lt;BR /&gt; *&lt;BR /&gt; * SPDX-License-Identifier: BSD-3-Clause&lt;BR /&gt; */&lt;/P&gt;&lt;P&gt;/* Standard C Included Files */&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;BR /&gt;#include "board.h"&lt;BR /&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include "fsl_i2c.h"&lt;BR /&gt;#include "fsl_i2c.h"&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;BR /&gt;#include "pin_mux.h"&lt;BR /&gt;#include "fsl_device_registers.h"&lt;BR /&gt;#include "fsl_common.h"&lt;BR /&gt;#include"lpc8xx_i2c.h"&lt;BR /&gt;#include"fsl_usart.h"&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Definitions&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;&lt;BR /&gt;#define BOARD_LED_PIN 23U&lt;BR /&gt;#define SWITCH_PORT 0U&lt;BR /&gt;#define SWITCH_PIN 28U&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;static void EXAMPLE_USARTInit(void);&lt;BR /&gt;void delay_ms(int a);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gpio_pin_config_t led_config = {kGPIO_DigitalOutput, 0,};&lt;BR /&gt; gpio_pin_config_t SWITCH_config = { kGPIO_DigitalInput, 0,};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; GPIO_PortInit(GPIO, BOARD_LED_PORT);&lt;BR /&gt; GPIO_PinInit(GPIO, BOARD_LED_PORT, BOARD_LED_PIN, &amp;amp;led_config);&lt;/P&gt;&lt;P&gt;GPIO_PortInit(GPIO, SWITCH_PORT);&lt;BR /&gt; GPIO_PinInit(GPIO, SWITCH_PORT, SWITCH_PIN, &amp;amp; SWITCH_config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while(1)&lt;BR /&gt; {&lt;BR /&gt; while(GPIO_PinRead(GPIO,SWITCH_PORT, 1u &amp;lt;&amp;lt; SWITCH_PIN)==1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPIO_PortToggle(GPIO, BOARD_LED_PORT, 1u &amp;lt;&amp;lt; BOARD_LED_PIN);&lt;/P&gt;&lt;P&gt;} // end of while 1&lt;/P&gt;&lt;P&gt;} // end of main&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static inline uint32_t GPIO_PinRead(GPIO_Type *base, uint32_t port, uint32_t pin)&lt;BR /&gt;{&lt;BR /&gt; return (uint32_t)base-&amp;gt;B[port][pin];&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2019 14:39:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915473#M36567</guid>
      <dc:creator>aravindpb5009</dc:creator>
      <dc:date>2019-07-29T14:39:07Z</dc:date>
    </item>
    <item>
      <title>Re:  problem in GPIO reading</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915474#M36568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Aranvind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order for me to better assist you, can you please confirm the microcontroller that you are using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2019 15:56:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915474#M36568</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2019-07-29T15:56:26Z</dc:date>
    </item>
    <item>
      <title>Re:  problem in GPIO reading</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915475#M36569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LPC824, Mcuxpresso IDE&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;amp; Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aravind P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 08:12:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915475#M36569</guid>
      <dc:creator>aravindpb5009</dc:creator>
      <dc:date>2019-07-30T08:12:29Z</dc:date>
    </item>
    <item>
      <title>Re:  problem in GPIO reading</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915476#M36570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Aravind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After checking your code, I dont see where the clock for the port is being initialized. Please try to enable to correct clock for the led and switch you are using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to see an example, you can use the LPCXpresso824max_gpio_led_ouput example which is available in the SDK.&lt;/P&gt;&lt;P&gt;This example uses a switch to toggle a led just as you are doing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can download the sdk &lt;A href="https://mcuxpresso.nxp.com/en/welcome"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 14:49:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/problem-in-GPIO-reading/m-p/915476#M36570</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2019-07-30T14:49:25Z</dc:date>
    </item>
  </channel>
</rss>

