<?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のトピックMRT: registers IRQ_FLAG vs STAT</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558893#M15715</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alagner on Sun Apr 27 13:18:28 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I've managed to run MRT successfully, yet I'm still pretty much interested in one thing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have MRT's channel 0 configured, it counts as it is supposed to etc. My ISR looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(It's not supposed to blink LED in the real project, but I wanted to isolate the problem)&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;
LPC_MRT-&amp;gt;Channel[0].STAT |= 1;
led_toggle();
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and it works fine - diode blinks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it should also be possible to use the IRQ_STAT register, in a way like this (at least that's the way I understand the manual):&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;
uint32_t temp = LPC_MRT-&amp;gt;IRQ_FLAG; //read flags
LPC_MRT-&amp;gt;IRQ_FLAG = temp &amp;amp; 15; //write ones to ones
led_toggle(); //blink&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the funny thing is that the led never blinks, and step debugging shows the following:&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;
uint32_t temp = LPC_MRT-&amp;gt;IRQ_FLAG; // after single stepping through this, temp equals 0, but peripheral view shows 1 in register, how come?
LPC_MRT-&amp;gt;IRQ_FLAG = temp &amp;amp; 15; //and I'm landing in defaultHandler, so sth went wrong, gotta check what fault is this
led_toggle(); //never gets here
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is even more suspicious, this&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;
uint32_t temp = LPC_MRT-&amp;gt;IRQ_FLAG; // temp still zero
led_toggle(); //voila, it blinks!
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;operates perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I can use chnnel's STAT instead of IRQ_FLAG and live with that, that's not much of a problem, but I'm just curious about the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The manual states this about IRQ_FLAG:&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Pending interrupt. The interrupt is pending because TIMER0&lt;BR /&gt;has reached the end of the time interval. If the INTEN bit in the&lt;BR /&gt;CONTROL0 register is also set to 1, the interrupt for timer&lt;BR /&gt;channel 0 and the global interrupt are raised.&lt;BR /&gt;Writing a 1 to this bit clears the interrupt request&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maciek&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:59:48 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:59:48Z</dc:date>
    <item>
      <title>MRT: registers IRQ_FLAG vs STAT</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558893#M15715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alagner on Sun Apr 27 13:18:28 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I've managed to run MRT successfully, yet I'm still pretty much interested in one thing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have MRT's channel 0 configured, it counts as it is supposed to etc. My ISR looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(It's not supposed to blink LED in the real project, but I wanted to isolate the problem)&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;
LPC_MRT-&amp;gt;Channel[0].STAT |= 1;
led_toggle();
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and it works fine - diode blinks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it should also be possible to use the IRQ_STAT register, in a way like this (at least that's the way I understand the manual):&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;
uint32_t temp = LPC_MRT-&amp;gt;IRQ_FLAG; //read flags
LPC_MRT-&amp;gt;IRQ_FLAG = temp &amp;amp; 15; //write ones to ones
led_toggle(); //blink&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the funny thing is that the led never blinks, and step debugging shows the following:&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;
uint32_t temp = LPC_MRT-&amp;gt;IRQ_FLAG; // after single stepping through this, temp equals 0, but peripheral view shows 1 in register, how come?
LPC_MRT-&amp;gt;IRQ_FLAG = temp &amp;amp; 15; //and I'm landing in defaultHandler, so sth went wrong, gotta check what fault is this
led_toggle(); //never gets here
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is even more suspicious, this&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;
uint32_t temp = LPC_MRT-&amp;gt;IRQ_FLAG; // temp still zero
led_toggle(); //voila, it blinks!
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;operates perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I can use chnnel's STAT instead of IRQ_FLAG and live with that, that's not much of a problem, but I'm just curious about the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The manual states this about IRQ_FLAG:&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Pending interrupt. The interrupt is pending because TIMER0&lt;BR /&gt;has reached the end of the time interval. If the INTEN bit in the&lt;BR /&gt;CONTROL0 register is also set to 1, the interrupt for timer&lt;BR /&gt;channel 0 and the global interrupt are raised.&lt;BR /&gt;Writing a 1 to this bit clears the interrupt request&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maciek&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:59:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558893#M15715</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: MRT: registers IRQ_FLAG vs STAT</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558894#M15716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by nxp_apps on Fri May 09 14:12:46 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please refer to the LPCOpen code (mrt peripheral example)...it uses the IRQ_FLAG to clear the interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fnxpfile%2Flpcopen-software-development-platform-lpc8xx-packages" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc8xx-packages&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;nxp_support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:59:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558894#M15716</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: MRT: registers IRQ_FLAG vs STAT</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558895#M15717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Sat May 10 03:43:13 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Maciek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;very strange. On my system everything works as YOU expect it. Every one of the 3 first lines of handlerMrt() alone works in my program (attached).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's interesting: in User Manual version 1.5 appeared a &lt;/SPAN&gt;&lt;STRONG&gt;third MRT mode&lt;/STRONG&gt;&lt;SPAN&gt;: "one shot bus stall" - &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sound like a handy tool for quick and dirty GPIO bit banging&amp;nbsp; 8-) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: and yes, using that mode for the main loop busy delay saves a 1mA@12MHz!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:59:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558895#M15717</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: MRT: registers IRQ_FLAG vs STAT</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558896#M15718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MICHALKO12 on Sat May 10 09:56:41 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.elektroda.pl%2Frtvforum%2Fviewtopic.php%3Fp%3D13552312%2313552312" rel="nofollow" target="_blank"&gt;http://www.elektroda.pl/rtvforum/viewtopic.php?p=13552312#13552312&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:59:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MRT-registers-IRQ-FLAG-vs-STAT/m-p/558896#M15718</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:59:49Z</dc:date>
    </item>
  </channel>
</rss>

