<?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のトピックAnalog comparator interrupt handler</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Analog-comparator-interrupt-handler/m-p/597133#M32151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CroesJeroen on Fri Feb 01 15:34:33 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm facing a difficulty with the analog comparator. I use 1.66V for the - input of the comparator (with the voltage ladder) and a analog input for the + input of the comp. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The output of the comparator0 works just fine, it go's high when V+&amp;gt;V-. I'm debugging it and checking the comparator register, CMP0STAT&amp;nbsp; give the status of the comparator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the comparator interrupt to the NVIC but it just doesnt jump to the handler?!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1227&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;
void InitCMP(void){
set the inputs, comparator, voltage ladder....
 
NVIC_ClearPendingIRQ(CMP_IRQn);
NVIC_EnableIRQ(CMP_IRQn);

}

&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;
void COMP_IRQHandler(void){

LPC_ACOMP-&amp;gt;CMP |= INTCOMPCLR; // reset the interrupt status
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully someone used this before and maybe encountered the same problem!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;kind regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 21:41:22 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T21:41:22Z</dc:date>
    <item>
      <title>Analog comparator interrupt handler</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Analog-comparator-interrupt-handler/m-p/597133#M32151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CroesJeroen on Fri Feb 01 15:34:33 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm facing a difficulty with the analog comparator. I use 1.66V for the - input of the comparator (with the voltage ladder) and a analog input for the + input of the comp. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The output of the comparator0 works just fine, it go's high when V+&amp;gt;V-. I'm debugging it and checking the comparator register, CMP0STAT&amp;nbsp; give the status of the comparator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the comparator interrupt to the NVIC but it just doesnt jump to the handler?!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1227&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;
void InitCMP(void){
set the inputs, comparator, voltage ladder....
 
NVIC_ClearPendingIRQ(CMP_IRQn);
NVIC_EnableIRQ(CMP_IRQn);

}

&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;
void COMP_IRQHandler(void){

LPC_ACOMP-&amp;gt;CMP |= INTCOMPCLR; // reset the interrupt status
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully someone used this before and maybe encountered the same problem!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;kind regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:41:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Analog-comparator-interrupt-handler/m-p/597133#M32151</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Analog comparator interrupt handler</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Analog-comparator-interrupt-handler/m-p/597134#M32152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MikeSimmonds on Fri Feb 01 16:14:25 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;[FONT=Tahoma][SIZE=2]I don't use CMSIS/RedLib, but suggest that you double check that the addresses&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;of your handler (COMP_IrqHandler -- by the way, I [I]really[/I] hate underscores!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is at the proper place in the vector table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IIRC and depending on the compier used, that [I]should[/I] be done -- for instance, I think&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the Code Red setup defines a handler for all possible interrupts with the 'weak' attribute&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(in starup_something.c) whereupon you defininition will 'override' the weak attribute&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and be used for interrupt handling. I haven't time to check, but the name of the handler&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;must be [I]exactly[/I] the same -- and I don't think that your's is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, remember to declare your handler as a public symbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps a bit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[/SIZE][/FONT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:41:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Analog-comparator-interrupt-handler/m-p/597134#M32152</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Analog comparator interrupt handler</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Analog-comparator-interrupt-handler/m-p/597135#M32153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CroesJeroen on Sun Feb 03 10:35:43 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got it, I placed a breakpoint on the while so when I pressed run it always stopped on the while. The output of the comparator gos high but theres a certain delay and that why it never went to the interrupt handler. After removing the breakpoint on the while and letting it run, it went to the handler.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:41:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Analog-comparator-interrupt-handler/m-p/597135#M32153</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:41:24Z</dc:date>
    </item>
  </channel>
</rss>

