<?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>LPC MicrocontrollersのトピックRe: [SOLVED] Labtool LPC812 PIO0_1 not usable as GPIO?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SOLVED-Labtool-LPC812-PIO0-1-not-usable-as-GPIO/m-p/569071#M17852</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larryvc on Wed Dec 17 01:52:23 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&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;&amp;nbsp; liaochengyi, thank you for the reply, you are absolutely right.&amp;nbsp; I had to read your post several times before I figured out where to look for where the clkout pin was set.&amp;nbsp; I finally got it, sysinit.c, and more precisely in board_sysinit.c function SystemSetupMuxing().&amp;nbsp; Never thought to look at the sysinit and board startup code.&amp;nbsp; Mystery solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I added to the code above to make PIO0_1 work as a usable GPIO pin:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
/* Unassign CLKOUT pin, as calls in board_sysinit.c set it to PIO0_1 by default*/
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
LPC_SWM-&amp;gt;PINASSIGN[8] = 0xFFFFFFFF;
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:11:27 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:11:27Z</dc:date>
    <item>
      <title>[SOLVED] Labtool LPC812 PIO0_1 not usable as GPIO?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SOLVED-Labtool-LPC812-PIO0-1-not-usable-as-GPIO/m-p/569069#M17850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larryvc on Sun Dec 14 21:56:31 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a very similar problem as the one in the &lt;/SPAN&gt;&lt;A _jive_internal="true" class="" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fhttp%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpc812-pio01-gpio-problem" rel="nofollow noopener noreferrer" target="_blank"&gt;lpc812-pio01-gpio-problem&lt;/A&gt;&lt;SPAN&gt; thread and was discovered while helping to solve the problem there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Concerning the Labtool's LPC812, I would like to know why there is always a clock signal on PIO0_1 even when the board is powered separately, running release software, and there are no debug connections at all.&amp;nbsp; According to the Labtool schematic PIO0_1 only goes to an internal header and nowhere else.&amp;nbsp; Isn't PIO0_1 supposed to be GPIO after a chip reset?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My program for testing in LPCOpen is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(The second include is 'cr_section_macros.h' without the quotes between left and right carets. How do you enter something between left and right carets in the WYSIWYG editor and have it display?&amp;nbsp; Seems like a bit of a problem for posting C source code. Program source code is attached.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;
/*
===============================================================================
 Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : GPIO0_1_Test.c
 Author&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : $(author)
 Version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :
 Copyright&amp;nbsp;&amp;nbsp; : $(copyright)
 Description : main definition
===============================================================================
*/

#include "chip.h"
#include &amp;lt;cr_section_macros.h&amp;gt;

const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;

enum PORTS {PORT0};

enum GPIO0PIO&amp;nbsp; // For the TSSOP20 and SOP20 packages
{PIO0_0,PIO0_1,PIO0_2,PIO0_3,PIO0_4,PIO0_5,PIO0_6,PIO0_7,
PIO0_8,PIO0_9,PIO0_10,PIO0_11,PIO0_12,PIO0_13,PIO0_14,PIO0_15,
PIO0_16,PIO0_17};

enum INOUT {IN, OUT};
enum LOWHIGH {LOW, HIGH};

int main(void) {

SystemCoreClockUpdate();

Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO);

Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, PORT0, PIO0_1);

Chip_GPIO_SetPinState(LPC_GPIO_PORT, PORT0, PIO0_1, LOW);

// GPIO0_1 should be low, but there is a clock signal there. Why?

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Force the counter to be placed into memory
&amp;nbsp;&amp;nbsp;&amp;nbsp; volatile static int i = 0 ;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enter an infinite loop, just incrementing a counter
&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++ ;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0 ;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337986" rel="nofollow noopener noreferrer" target="_blank"&gt;GPIO0_1_Test.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:11:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SOLVED-Labtool-LPC812-PIO0-1-not-usable-as-GPIO/m-p/569069#M17850</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Labtool LPC812 PIO0_1 not usable as GPIO?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SOLVED-Labtool-LPC812-PIO0-1-not-usable-as-GPIO/m-p/569070#M17851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by liaochengyi on Tue Dec 16 02:39:00 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also used LPC812 now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked the result of PIO01 action. It's OK. I can use it to be GPIO.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need disable the clock out setting of PIO01 in sysinit and set the GPIO register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; :)&amp;nbsp; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:11:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SOLVED-Labtool-LPC812-PIO0-1-not-usable-as-GPIO/m-p/569070#M17851</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Labtool LPC812 PIO0_1 not usable as GPIO?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SOLVED-Labtool-LPC812-PIO0-1-not-usable-as-GPIO/m-p/569071#M17852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larryvc on Wed Dec 17 01:52:23 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&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;&amp;nbsp; liaochengyi, thank you for the reply, you are absolutely right.&amp;nbsp; I had to read your post several times before I figured out where to look for where the clkout pin was set.&amp;nbsp; I finally got it, sysinit.c, and more precisely in board_sysinit.c function SystemSetupMuxing().&amp;nbsp; Never thought to look at the sysinit and board startup code.&amp;nbsp; Mystery solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I added to the code above to make PIO0_1 work as a usable GPIO pin:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
/* Unassign CLKOUT pin, as calls in board_sysinit.c set it to PIO0_1 by default*/
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
LPC_SWM-&amp;gt;PINASSIGN[8] = 0xFFFFFFFF;
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:11:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SOLVED-Labtool-LPC812-PIO0-1-not-usable-as-GPIO/m-p/569071#M17852</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:11:27Z</dc:date>
    </item>
  </channel>
</rss>

