<?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: How can changing P1_2 state from low to high output be seen in P1_6? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522682#M50159</link>
    <description>&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;Thank you for your reply. As I don't reckon the issue is caused by faulty hardware (as I only read out the pin, same as say putting an LED on pin P1_9), I will for now only cover the software I have.&lt;/P&gt;&lt;P&gt;Initializer code is as follows (within main):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 1, 2); //for some reason this one triggers on the 1,9 port
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 1, 9); //port output wire is connected to

Chip_SCU_PinMuxSet(9,0, SCU_PINIO_FAST); // SCU_MODE_FUNC0 | SCU_PINIO_FAST);
Chip_SCU_PinMuxSet(9,1, SCU_PINIO_FAST); // SCU_MODE_FUNC0 | SCU_PINIO_FAST);

Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT,4,12);
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT,4,13);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the functioning code is as follows (within an infinite loop):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Board_LED_Set(1, true);
//Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 2, true); //outputs on 1,9?
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 9, true); //nothing on 1,9?

_delay_ms(200); //wait, custom function

//Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 2, false); // deactivate power
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 9, false); // deactivate power
Board_LED_Set(1, false);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With maybe the important functions for how the pinstate is set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/**
 * @brief	Set GPIO direction for a single GPIO pin to an output
 * 	pGPIO	: The base of GPIO peripheral on the chip
 * 	port	: GPIO Port number where @a pin is located
 * 	pin		: GPIO pin to set direction on as output
 * @return	Nothing
 */
STATIC INLINE void Chip_GPIO_SetPinDIROutput(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin)
{
	pGPIO-&amp;gt;DIR[port] |= 1UL &amp;lt;&amp;lt; pin;
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="c"&gt;/**
 * @brief	Set a GPIO pin state via the GPIO byte register
 * 	pGPIO	: The base of GPIO peripheral on the chip
 *  	port	: GPIO Port number where @a pin is located
 * 	pin		: GPIO pin to set
 * 	setting	: true for high, false for low
 * @return	Nothing
 * @note	This function replaces Chip_GPIO_WritePortBit()
 */
STATIC INLINE void Chip_GPIO_SetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin, bool setting)
{
	pGPIO-&amp;gt;B[port][pin] = setting;
}&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;I am not seeing anything being done differently, but I might be overlooking something.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 07:59:42 GMT</pubDate>
    <dc:creator>Gaico</dc:creator>
    <dc:date>2022-09-15T07:59:42Z</dc:date>
    <item>
      <title>How can changing P1_2 state from low to high output be seen in P1_6?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522176#M50150</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We are currently trying to figure out why two pins seem almost interchangeable in controlling a HIGH/LOW output on the&amp;nbsp;OM13084 board. Header: J1.19.&lt;/P&gt;&lt;P&gt;The setup is as follows:&lt;/P&gt;&lt;P&gt;An oscilloscope is connected to pin P1_6 on the board. When changing the state of the P1_6 pin (which is set to GPIO output) from low to high, nothing happens. When then changing the state of the P1_2 pin, we can see a change in output as expected when trying to change the P1_6 pin.&lt;/P&gt;&lt;P&gt;Short notation of the question is thus: Is there a reason as to why I cannot directly change the state of the P1_6 pin, only through changing P1_2? I am not configuring them any different in code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this question is not too vague, but I would appreciate any kind of input!&lt;/P&gt;&lt;P&gt;Take care&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 18:54:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522176#M50150</guid>
      <dc:creator>Gaico</dc:creator>
      <dc:date>2022-09-14T18:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can changing P1_2 state from low to high output be seen in P1_6?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522430#M50153</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Please take a picture about your hardware connection when measure P1_6,&lt;/P&gt;
&lt;P&gt;also show your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 01:55:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522430#M50153</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-09-15T01:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can changing P1_2 state from low to high output be seen in P1_6?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522525#M50155</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; An oscilloscope is connected to pin P1_6 on the board. When changing the state of the P1_6 pin (which is set to GPIO output) from low to high, nothing happens. When then changing the state of the P1_2 pin, we can see a change in output as expected when trying to change the P1_6 pin.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;First thing I would do ist to measure the connections from J1.19 to both pins with an Ohmmeter, with power off.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I guess you have checked the schematics already.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 04:51:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522525#M50155</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2022-09-15T04:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can changing P1_2 state from low to high output be seen in P1_6?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522682#M50159</link>
      <description>&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;Thank you for your reply. As I don't reckon the issue is caused by faulty hardware (as I only read out the pin, same as say putting an LED on pin P1_9), I will for now only cover the software I have.&lt;/P&gt;&lt;P&gt;Initializer code is as follows (within main):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 1, 2); //for some reason this one triggers on the 1,9 port
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 1, 9); //port output wire is connected to

Chip_SCU_PinMuxSet(9,0, SCU_PINIO_FAST); // SCU_MODE_FUNC0 | SCU_PINIO_FAST);
Chip_SCU_PinMuxSet(9,1, SCU_PINIO_FAST); // SCU_MODE_FUNC0 | SCU_PINIO_FAST);

Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT,4,12);
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT,4,13);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the functioning code is as follows (within an infinite loop):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Board_LED_Set(1, true);
//Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 2, true); //outputs on 1,9?
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 9, true); //nothing on 1,9?

_delay_ms(200); //wait, custom function

//Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 2, false); // deactivate power
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 9, false); // deactivate power
Board_LED_Set(1, false);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With maybe the important functions for how the pinstate is set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/**
 * @brief	Set GPIO direction for a single GPIO pin to an output
 * 	pGPIO	: The base of GPIO peripheral on the chip
 * 	port	: GPIO Port number where @a pin is located
 * 	pin		: GPIO pin to set direction on as output
 * @return	Nothing
 */
STATIC INLINE void Chip_GPIO_SetPinDIROutput(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin)
{
	pGPIO-&amp;gt;DIR[port] |= 1UL &amp;lt;&amp;lt; pin;
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="c"&gt;/**
 * @brief	Set a GPIO pin state via the GPIO byte register
 * 	pGPIO	: The base of GPIO peripheral on the chip
 *  	port	: GPIO Port number where @a pin is located
 * 	pin		: GPIO pin to set
 * 	setting	: true for high, false for low
 * @return	Nothing
 * @note	This function replaces Chip_GPIO_WritePortBit()
 */
STATIC INLINE void Chip_GPIO_SetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin, bool setting)
{
	pGPIO-&amp;gt;B[port][pin] = setting;
}&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;I am not seeing anything being done differently, but I might be overlooking something.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 07:59:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522682#M50159</guid>
      <dc:creator>Gaico</dc:creator>
      <dc:date>2022-09-15T07:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can changing P1_2 state from low to high output be seen in P1_6?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522768#M50161</link>
      <description>&lt;P&gt;I found the issue, it was my mistake for looking in the wrong place.&lt;/P&gt;&lt;P&gt;I was assuming the name(s) on the demo board were the same as the names needed in the code.&lt;/P&gt;&lt;P&gt;If looking in the datasheet, pin P1_6 has GPIO1[2], which was used in the code.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gaico_0-1663232427972.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/193769i674BD0D95BC98BE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gaico_0-1663232427972.png" alt="Gaico_0-1663232427972.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After doing this with another test port (P1_7 which turned into GPIO1[0]) everything works as expected.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gaico_1-1663232444472.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/193770i6F214827238B635E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gaico_1-1663232444472.png" alt="Gaico_1-1663232444472.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 09:00:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-can-changing-P1-2-state-from-low-to-high-output-be-seen-in/m-p/1522768#M50161</guid>
      <dc:creator>Gaico</dc:creator>
      <dc:date>2022-09-15T09:00:50Z</dc:date>
    </item>
  </channel>
</rss>

