<?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>LPCXpresso IDEのトピックRe: Question to GPIO</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Question-to-GPIO/m-p/590554#M29168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ledi007 on Wed Jan 27 05:04:22 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;!!!! I solved the problem already!!!! :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 02:47:06 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T02:47:06Z</dc:date>
    <item>
      <title>Question to GPIO</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Question-to-GPIO/m-p/590553#M29167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ledi007 on Wed Jan 27 04:47:42 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;im new in programming an arm-controller and using lpcxpresso with the lpcxpresso board lpc1114.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, i use the example project "cmsis2_blinky" and want to control a LED on PORT0, Bit10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First, i set the direction register and in the while-loop the portin every half a second to high or low.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The result is, that the LED on PORT0 Bit10 is toggeling with an high frequency.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you explain, why this is?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
//*****************************************************************************
//&amp;nbsp;&amp;nbsp; +--+
//&amp;nbsp;&amp;nbsp; | ++----+
//&amp;nbsp;&amp;nbsp; +-++&amp;nbsp;&amp;nbsp;&amp;nbsp; |
//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |
//&amp;nbsp;&amp;nbsp; +-+--+&amp;nbsp; |
//&amp;nbsp;&amp;nbsp; | +--+--+
//&amp;nbsp;&amp;nbsp; +----+&amp;nbsp;&amp;nbsp;&amp;nbsp; Copyright (c) 2010-11 Code Red Technologies Ltd.
//
// LED flashing Timer16 application for LPCXPresso1114 board
//
// Software License Agreement
//
// The software is owned by Code Red Technologies and/or its suppliers, and is
// protected under applicable copyright laws.&amp;nbsp; All rights are reserved.&amp;nbsp; Any
// use in violation of the foregoing restrictions may subject the user to criminal
// sanctions under applicable laws, as well as to civil liability for the breach
// of the terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".&amp;nbsp; NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// USE OF THIS SOFTWARE FOR COMMERCIAL DEVELOPMENT AND/OR EDUCATION IS SUBJECT
// TO A CURRENT END USER LICENSE AGREEMENT (COMMERCIAL OR EDUCATIONAL) WITH
// CODE RED TECHNOLOGIES LTD.
//
//*****************************************************************************


#include "LPC11xx.h"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* LPC11xx definitions */
#include "timer16.h"
#include "clkconfig.h"
#include "gpio.h"

#include &amp;lt;cr_section_macros.h&amp;gt;
#include &amp;lt;NXP/crp.h&amp;gt;

// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;

// LPCXpresso processor card LED
#define LED_PORT 0// Port for led
#define LED_BIT 7// Bit on port for led
#define LED_ON 1// Level to set port to turn on led
#define LED_OFF 0// Level to set port to turn off led

extern volatile uint32_t timer16_0_counter;

int main (void)
{
&amp;nbsp; GPIOInit();

&amp;nbsp; // Initialise Timer16_0 to tick at rate of 1/2000th of second.
// Note that as this is a 16 bit timer, the maximum count we can
// load into timer is 0xFFFF, or 65535. Default clock speed
// set up by CMSIS SystemInit function - SystemCoreClock - is
// 48MHz or 48000000 Hz. Dividing this by 2000 is 24000 which is
// within appropriate timer16 maximum. This could be extended
// if timer routine extended to make use of Prescale Counter register
// Note by default LPC_SYSCON-&amp;gt;SYSAHBCLKDIV is 1.
&amp;nbsp; init_timer16(0, (SystemCoreClock/LPC_SYSCON-&amp;gt;SYSAHBCLKDIV)/2000 );

&amp;nbsp; // Initialise counter that counts Timer16_0 ticks
&amp;nbsp; timer16_0_counter = 0;

&amp;nbsp; //Enable Timer16_0
&amp;nbsp; enable_timer16(0);

&amp;nbsp; // Set port for LED to output
&amp;nbsp; GPIOSetDir( LED_PORT, LED_BIT, 1 );
&amp;nbsp; GPIOSetDir( 0, 10, 1 );// Set PORT0 direction Bit10 to output

&amp;nbsp; while (1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Loop forever */
&amp;nbsp; {

// LED is on for 1st half-second
if ( (timer16_0_counter &amp;gt; 0) &amp;amp;&amp;amp; (timer16_0_counter &amp;lt;= 1000) )
{
GPIOSetValue( LED_PORT, LED_BIT, LED_OFF );
GPIOSetValue(0,10,1);// PORT0 Bit10 High
}

// LED is off for 2nd half-second
if ( (timer16_0_counter &amp;gt; 1000) &amp;amp;&amp;amp; (timer16_0_counter &amp;lt;= 2000) )
{
GPIOSetValue( LED_PORT, LED_BIT, LED_ON );
GPIOSetValue(0,10,0);// PORT0 Bit10 Low
}

// Reset counter
else if ( timer16_0_counter &amp;gt; 2000 )
{
timer16_0_counter = 0;
}
&amp;nbsp; }
}

&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:47:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Question-to-GPIO/m-p/590553#M29167</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Question to GPIO</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Question-to-GPIO/m-p/590554#M29168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ledi007 on Wed Jan 27 05:04:22 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;!!!! I solved the problem already!!!! :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:47:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Question-to-GPIO/m-p/590554#M29168</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:47:06Z</dc:date>
    </item>
  </channel>
</rss>

