<?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中的主题 Why the interruptions are not working?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-the-interruptions-are-not-working/m-p/716670#M28960</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im using lpc xpresso 1769, and the pin with the interrupt is on the pin of the image.&lt;/P&gt;&lt;P&gt;I Run the code a couple of times, what the interrupt does is change the value of a boolean to execute a sum or subtraction; but after a while it stopped working.&lt;/P&gt;&lt;P&gt;The interrupt is a push button NA.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Inkedlpc1769_3 (2)_LI.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/8477i4DE4146D338F82B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Inkedlpc1769_3 (2)_LI.jpg" alt="Inkedlpc1769_3 (2)_LI.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#ifdef __USE_CMSIS&lt;BR /&gt;#include "LPC17xx.h"&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;#include &amp;lt;cr_section_macros.h&amp;gt;&lt;BR /&gt;#include &amp;lt;NXP/crp.h&amp;gt;&lt;BR /&gt;#include "lpc17xx_gpio.h"&lt;BR /&gt;#include "lpc17xx_timer.h"&lt;BR /&gt;#include &amp;lt;math.h&amp;gt;&lt;BR /&gt;#include "lpc17xx_adc.h"&lt;BR /&gt;#include "lpc17xx_pinsel.h"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Variable to store CRP value in. Will be placed automatically&lt;BR /&gt;// by the linker when "Enable Code Read Protect" selected.&lt;BR /&gt;// See crp.h header for more information&lt;BR /&gt;__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;&lt;BR /&gt;typedef int bool;&lt;BR /&gt;#define true 1&lt;BR /&gt;#define false 0&lt;BR /&gt;#define USERTASK_STACK_SIZE configMINIMAL_STACK_SIZE&lt;/P&gt;&lt;P&gt;extern int Timer0_Wait();&lt;BR /&gt;// TODO: insert other include files here&lt;/P&gt;&lt;P&gt;// TODO: insert other definitions and declarations here&lt;/P&gt;&lt;P&gt;/** Fast GPIO port 0 byte accessible definition */&lt;/P&gt;&lt;P&gt;bool toggle=0;&lt;BR /&gt;int lectura1;&lt;BR /&gt;int lectura2;&lt;BR /&gt;int suma,r;&lt;BR /&gt;int intput,intput2;&lt;/P&gt;&lt;P&gt;void INIT_RGB (void);&lt;BR /&gt;void Contador_RGB(void);&lt;/P&gt;&lt;P&gt;uint32_t del =0x00000FFF;&lt;BR /&gt;uint32_t var2=0x00000000;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void CONFIG_GPIO (void);//prototipo de la funcion&lt;BR /&gt;void Int_Out (void);&lt;/P&gt;&lt;P&gt;char Inputs;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;CONFIG_GPIO ();//llamada a la funcion&lt;/P&gt;&lt;P&gt;while(1)&lt;BR /&gt; {&lt;BR /&gt; Int_Out();&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void CONFIG_GPIO (void)//funcion&lt;BR /&gt;{&lt;BR /&gt; GPIO_SetDir(2,0x000000FF, 1);&lt;BR /&gt; GPIO_ClearValue(2,0x000000FF);&lt;BR /&gt; GPIO_SetDir(0,0x000000FF, 0);&lt;BR /&gt; GPIO_ClearValue(0,0x000000FF);&lt;BR /&gt; GPIO_IntCmd(0,0x00002000,0);&lt;BR /&gt; NVIC_EnableIRQ(EINT3_IRQn);&lt;BR /&gt;}&lt;BR /&gt;void Int_Out(void)&lt;BR /&gt;{&lt;BR /&gt; //char PrimerTermino;&lt;BR /&gt; //char SegundoTermino;&lt;BR /&gt; intput = GPIO_ReadValue(0)&amp;amp;0xF;&lt;BR /&gt; intput2 = (GPIO_ReadValue(0)&amp;amp;0xF0)&amp;gt;&amp;gt;4;&lt;BR /&gt; if(r!=1){&lt;BR /&gt; suma = intput - intput2;&lt;BR /&gt; }&lt;BR /&gt; else{&lt;BR /&gt; suma = intput + intput2;&lt;BR /&gt; }&lt;BR /&gt; GPIO_SetValue(2,suma);&lt;BR /&gt; GPIO_ClearValue(2,0xFF);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern void EINT3_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; if(r==0){&lt;BR /&gt; r=1;&lt;BR /&gt; }&lt;BR /&gt; else{&lt;BR /&gt; r = 0;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;GPIO_ClearInt(2,0x00002000);&lt;BR /&gt; toggle=!toggle;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2018 07:45:23 GMT</pubDate>
    <dc:creator>omarantonioniño</dc:creator>
    <dc:date>2018-05-24T07:45:23Z</dc:date>
    <item>
      <title>Why the interruptions are not working?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-the-interruptions-are-not-working/m-p/716670#M28960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im using lpc xpresso 1769, and the pin with the interrupt is on the pin of the image.&lt;/P&gt;&lt;P&gt;I Run the code a couple of times, what the interrupt does is change the value of a boolean to execute a sum or subtraction; but after a while it stopped working.&lt;/P&gt;&lt;P&gt;The interrupt is a push button NA.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Inkedlpc1769_3 (2)_LI.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/8477i4DE4146D338F82B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Inkedlpc1769_3 (2)_LI.jpg" alt="Inkedlpc1769_3 (2)_LI.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#ifdef __USE_CMSIS&lt;BR /&gt;#include "LPC17xx.h"&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;#include &amp;lt;cr_section_macros.h&amp;gt;&lt;BR /&gt;#include &amp;lt;NXP/crp.h&amp;gt;&lt;BR /&gt;#include "lpc17xx_gpio.h"&lt;BR /&gt;#include "lpc17xx_timer.h"&lt;BR /&gt;#include &amp;lt;math.h&amp;gt;&lt;BR /&gt;#include "lpc17xx_adc.h"&lt;BR /&gt;#include "lpc17xx_pinsel.h"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Variable to store CRP value in. Will be placed automatically&lt;BR /&gt;// by the linker when "Enable Code Read Protect" selected.&lt;BR /&gt;// See crp.h header for more information&lt;BR /&gt;__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;&lt;BR /&gt;typedef int bool;&lt;BR /&gt;#define true 1&lt;BR /&gt;#define false 0&lt;BR /&gt;#define USERTASK_STACK_SIZE configMINIMAL_STACK_SIZE&lt;/P&gt;&lt;P&gt;extern int Timer0_Wait();&lt;BR /&gt;// TODO: insert other include files here&lt;/P&gt;&lt;P&gt;// TODO: insert other definitions and declarations here&lt;/P&gt;&lt;P&gt;/** Fast GPIO port 0 byte accessible definition */&lt;/P&gt;&lt;P&gt;bool toggle=0;&lt;BR /&gt;int lectura1;&lt;BR /&gt;int lectura2;&lt;BR /&gt;int suma,r;&lt;BR /&gt;int intput,intput2;&lt;/P&gt;&lt;P&gt;void INIT_RGB (void);&lt;BR /&gt;void Contador_RGB(void);&lt;/P&gt;&lt;P&gt;uint32_t del =0x00000FFF;&lt;BR /&gt;uint32_t var2=0x00000000;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void CONFIG_GPIO (void);//prototipo de la funcion&lt;BR /&gt;void Int_Out (void);&lt;/P&gt;&lt;P&gt;char Inputs;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;CONFIG_GPIO ();//llamada a la funcion&lt;/P&gt;&lt;P&gt;while(1)&lt;BR /&gt; {&lt;BR /&gt; Int_Out();&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void CONFIG_GPIO (void)//funcion&lt;BR /&gt;{&lt;BR /&gt; GPIO_SetDir(2,0x000000FF, 1);&lt;BR /&gt; GPIO_ClearValue(2,0x000000FF);&lt;BR /&gt; GPIO_SetDir(0,0x000000FF, 0);&lt;BR /&gt; GPIO_ClearValue(0,0x000000FF);&lt;BR /&gt; GPIO_IntCmd(0,0x00002000,0);&lt;BR /&gt; NVIC_EnableIRQ(EINT3_IRQn);&lt;BR /&gt;}&lt;BR /&gt;void Int_Out(void)&lt;BR /&gt;{&lt;BR /&gt; //char PrimerTermino;&lt;BR /&gt; //char SegundoTermino;&lt;BR /&gt; intput = GPIO_ReadValue(0)&amp;amp;0xF;&lt;BR /&gt; intput2 = (GPIO_ReadValue(0)&amp;amp;0xF0)&amp;gt;&amp;gt;4;&lt;BR /&gt; if(r!=1){&lt;BR /&gt; suma = intput - intput2;&lt;BR /&gt; }&lt;BR /&gt; else{&lt;BR /&gt; suma = intput + intput2;&lt;BR /&gt; }&lt;BR /&gt; GPIO_SetValue(2,suma);&lt;BR /&gt; GPIO_ClearValue(2,0xFF);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern void EINT3_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; if(r==0){&lt;BR /&gt; r=1;&lt;BR /&gt; }&lt;BR /&gt; else{&lt;BR /&gt; r = 0;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;GPIO_ClearInt(2,0x00002000);&lt;BR /&gt; toggle=!toggle;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 07:45:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Why-the-interruptions-are-not-working/m-p/716670#M28960</guid>
      <dc:creator>omarantonioniño</dc:creator>
      <dc:date>2018-05-24T07:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why the interruptions are not working?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-the-interruptions-are-not-working/m-p/716671#M28961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I highly recommend you to use the examples provided in the LPCOpen as a guide to see how to make the configurations for a pin interrupt. The example that suits your needs is the&amp;nbsp;periph_pinint, here you will see the configurations that are made to declare a GPIO pin as an interrupt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using MCUXpresso IDE then you will find the LPCOpen package in the next path:&lt;/P&gt;&lt;UL style="list-style-type: circle;"&gt;&lt;LI&gt;C:\nxp\MCUXpressoIDE_10.1.1_606\ide\Examples\LPCOpen\lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769.zip&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 18:09:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Why-the-interruptions-are-not-working/m-p/716671#M28961</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-05-30T18:09:27Z</dc:date>
    </item>
  </channel>
</rss>

