<?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 Not able to read the pin status in LPC 1114/302 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Not-able-to-read-the-pin-status-in-LPC-1114-302/m-p/610701#M23823</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i am using LPC 1114/302 but i am not able to read the stauts of the Port Pin(P1_1 and P1_3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part of my code is as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define LPC_GPIO &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((LPC_GPIO_T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *) LPC_GPIO_PORT0_BASE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef struct { /*!&amp;lt; GPIO_PORT Structure */&lt;BR /&gt; __IO uint32_t DATA[4096]; /*!&amp;lt; Offset: 0x0000 to 0x3FFC Data address masking register (R/W) */&lt;BR /&gt; uint32_t RESERVED1[4096];&lt;BR /&gt; __IO uint32_t DIR; /*!&amp;lt; Offset: 0x8000 Data direction register (R/W) */&lt;BR /&gt; __IO uint32_t IS; /*!&amp;lt; Offset: 0x8004 Interrupt sense register (R/W) */&lt;BR /&gt; __IO uint32_t IBE; /*!&amp;lt; Offset: 0x8008 Interrupt both edges register (R/W) */&lt;BR /&gt; __IO uint32_t IEV; /*!&amp;lt; Offset: 0x800C Interrupt event register (R/W) */&lt;BR /&gt; __IO uint32_t IE; /*!&amp;lt; Offset: 0x8010 Interrupt mask register (R/W) */&lt;BR /&gt; __I uint32_t RIS; /*!&amp;lt; Offset: 0x8014 Raw interrupt status register (R/ ) */&lt;BR /&gt; __I uint32_t MIS; /*!&amp;lt; Offset: 0x8018 Masked interrupt status register (R/ ) */&lt;BR /&gt; __O uint32_t IC; /*!&amp;lt; Offset: 0x801C Interrupt clear register (W) */&lt;BR /&gt; uint32_t RESERVED2[8184]; /* Padding added for aligning contiguous GPIO blocks */&lt;BR /&gt;} LPC_GPIO_T;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATIC INLINE bool Chip_GPIO_GetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin)&lt;BR /&gt;{&lt;BR /&gt; return (pGPIO[port].DATA[1 &amp;lt;&amp;lt; pin]) != 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chip_GPIO_GetPinState( LPC_GPIO, 1, 3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this function always returns a zero value irrespective of the pin status&lt;/P&gt;&lt;P&gt;Pl guide&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Apr 2017 04:57:37 GMT</pubDate>
    <dc:creator>monarchbaxi</dc:creator>
    <dc:date>2017-04-14T04:57:37Z</dc:date>
    <item>
      <title>Not able to read the pin status in LPC 1114/302</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Not-able-to-read-the-pin-status-in-LPC-1114-302/m-p/610701#M23823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i am using LPC 1114/302 but i am not able to read the stauts of the Port Pin(P1_1 and P1_3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part of my code is as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define LPC_GPIO &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((LPC_GPIO_T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *) LPC_GPIO_PORT0_BASE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef struct { /*!&amp;lt; GPIO_PORT Structure */&lt;BR /&gt; __IO uint32_t DATA[4096]; /*!&amp;lt; Offset: 0x0000 to 0x3FFC Data address masking register (R/W) */&lt;BR /&gt; uint32_t RESERVED1[4096];&lt;BR /&gt; __IO uint32_t DIR; /*!&amp;lt; Offset: 0x8000 Data direction register (R/W) */&lt;BR /&gt; __IO uint32_t IS; /*!&amp;lt; Offset: 0x8004 Interrupt sense register (R/W) */&lt;BR /&gt; __IO uint32_t IBE; /*!&amp;lt; Offset: 0x8008 Interrupt both edges register (R/W) */&lt;BR /&gt; __IO uint32_t IEV; /*!&amp;lt; Offset: 0x800C Interrupt event register (R/W) */&lt;BR /&gt; __IO uint32_t IE; /*!&amp;lt; Offset: 0x8010 Interrupt mask register (R/W) */&lt;BR /&gt; __I uint32_t RIS; /*!&amp;lt; Offset: 0x8014 Raw interrupt status register (R/ ) */&lt;BR /&gt; __I uint32_t MIS; /*!&amp;lt; Offset: 0x8018 Masked interrupt status register (R/ ) */&lt;BR /&gt; __O uint32_t IC; /*!&amp;lt; Offset: 0x801C Interrupt clear register (W) */&lt;BR /&gt; uint32_t RESERVED2[8184]; /* Padding added for aligning contiguous GPIO blocks */&lt;BR /&gt;} LPC_GPIO_T;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATIC INLINE bool Chip_GPIO_GetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin)&lt;BR /&gt;{&lt;BR /&gt; return (pGPIO[port].DATA[1 &amp;lt;&amp;lt; pin]) != 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chip_GPIO_GetPinState( LPC_GPIO, 1, 3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this function always returns a zero value irrespective of the pin status&lt;/P&gt;&lt;P&gt;Pl guide&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Apr 2017 04:57:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Not-able-to-read-the-pin-status-in-LPC-1114-302/m-p/610701#M23823</guid>
      <dc:creator>monarchbaxi</dc:creator>
      <dc:date>2017-04-14T04:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read the pin status in LPC 1114/302</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Not-able-to-read-the-pin-status-in-LPC-1114-302/m-p/610702#M23824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got the solution.... the problem was with configuring the pin ...the pin can also be used as analog pin and had to configure it to&amp;nbsp;&lt;SPAN&gt;IOCON_DIGMODE_EN ......though the reset value for this pin is DIGITAL FUNCTION &amp;nbsp;MODE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Problematic code&lt;/P&gt;&lt;P&gt;Chip_IOCON_PinMuxSet( LPC_IOCON ,CONFIG_SENSOR ,( IOCON_FUNC1 | IOCON_MODE_PULLDOWN ));&lt;/P&gt;&lt;P&gt;working code&lt;/P&gt;&lt;P&gt;Chip_IOCON_PinMuxSet( LPC_IOCON ,&lt;SPAN&gt;CONFIG_SENSOR &lt;/SPAN&gt;,( IOCON_FUNC1 | IOCON_MODE_PULLDOWN | IOCON_DIGMODE_EN));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Apr 2017 04:55:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Not-able-to-read-the-pin-status-in-LPC-1114-302/m-p/610702#M23824</guid>
      <dc:creator>monarchbaxi</dc:creator>
      <dc:date>2017-04-15T04:55:40Z</dc:date>
    </item>
  </channel>
</rss>

