<?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>topic Re: M5213EVB interrupt problem in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/M5213EVB-interrupt-problem/m-p/129245#M49</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;well, I found out that the problem i was having with the board halting was the printf statement. Once I removed that, the system operated fine in both debug mode and 'run' mode.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 Mar 2006 09:22:38 GMT</pubDate>
    <dc:creator>airswit</dc:creator>
    <dc:date>2006-03-26T09:22:38Z</dc:date>
    <item>
      <title>M5213EVB interrupt problem</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/M5213EVB-interrupt-problem/m-p/129243#M47</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I am very new to this development board/processor, and am having a bit of trouble coding a simple interrupt scheme. as you can see by the code below, the system should 'bounce' the leds back and forth forever. once a button is pressed, the system pauses, shows something else on the leds, and then i want it to return. everything is working fine, except that the system will not return back from whence it came (meaning the 'main loop'). can anybody give me any advice?&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;BR /&gt;[code]&lt;BR /&gt;&lt;BR /&gt;#define DELAY 100000 /* Delay in micro-seconds */&lt;BR /&gt;void main_loop(void);&lt;BR /&gt;__interrupt__ void sw1_handler(void);&lt;BR /&gt;__interrupt__ void sw2_handler(void);&lt;BR /&gt;void&lt;BR /&gt;board_led_display(int number)&lt;BR /&gt;{&lt;BR /&gt;/* Enable signals as GPIO */&lt;BR /&gt;MCF_GPIO_PTCPAR = 0&lt;BR /&gt;| MCF_GPIO_PTCPAR_TIN3_GPIO&lt;BR /&gt;| MCF_GPIO_PTCPAR_TIN2_GPIO&lt;BR /&gt;| MCF_GPIO_PTCPAR_TIN1_GPIO&lt;BR /&gt;| MCF_GPIO_PTCPAR_TIN0_GPIO;&lt;BR /&gt;&lt;BR /&gt;/* Set output values */&lt;BR /&gt;MCF_GPIO_PORTTC = (uint8)number;&lt;BR /&gt;&lt;BR /&gt;/* Enable signals as digital outputs */&lt;BR /&gt;MCF_GPIO_DDRTC = 0&lt;BR /&gt;| MCF_GPIO_DDRTC_DDRTC3&lt;BR /&gt;| MCF_GPIO_DDRTC_DDRTC2&lt;BR /&gt;| MCF_GPIO_DDRTC_DDRTC1&lt;BR /&gt;| MCF_GPIO_DDRTC_DDRTC0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;MCF_EPORT_EPPAR = 0&lt;BR /&gt;| MCF_EPORT_EPPAR_EPPA4_RISING&lt;BR /&gt;| MCF_EPORT_EPPAR_EPPA5_RISING&lt;BR /&gt;| MCF_EPORT_EPPAR_EPPA7_LEVEL;&lt;BR /&gt;mcf5xxx_set_handler(64 + 4, /*(ADDRESS)*/sw1_handler);&lt;BR /&gt;mcf5xxx_set_handler(64 + 5, /*(ADDRESS)*/sw2_handler);&lt;BR /&gt;&lt;BR /&gt;main_loop();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void main_loop(void)&lt;BR /&gt;{&lt;BR /&gt;int i;&lt;BR /&gt;mcf5xxx_irq_enable();&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;for (i = 1; i 8; i=1)&lt;BR /&gt;{&lt;BR /&gt;board_led_display(i);&lt;BR /&gt;cpu_pause(DELAY);&lt;BR /&gt;}&lt;BR /&gt;for (i = 8; i &amp;gt; 1; i&amp;gt;&amp;gt;=1)&lt;BR /&gt;{&lt;BR /&gt;board_led_display(i);&lt;BR /&gt;cpu_pause(DELAY);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;__interrupt__ void&lt;BR /&gt;sw1_handler(void)&lt;BR /&gt;{&lt;BR /&gt;int i;&lt;BR /&gt;for(i=0 ; i16 ; i++)&lt;BR /&gt;{&lt;BR /&gt;board_led_display(i);&lt;BR /&gt;cpu_pause(DELAY);&lt;BR /&gt;}&lt;BR /&gt;MCF_EPORT_EPFR = MCF_EPORT_EPFR_EPF4;&lt;BR /&gt;}&lt;BR /&gt;__interrupt__ void sw2_handler(void)&lt;BR /&gt;{&lt;BR /&gt;board_led_display(0);&lt;BR /&gt;cpu_pause(2000000);&lt;BR /&gt;printf("Button2 pushed!\n");&lt;BR /&gt;MCF_EPORT_EPFR = MCF_EPORT_EPFR_EPF5;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[/code]&lt;BR /&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;p.s. i am using the default codewarrior include files for this demo board.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 13:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/M5213EVB-interrupt-problem/m-p/129243#M47</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-03-20T13:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: M5213EVB interrupt problem</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/M5213EVB-interrupt-problem/m-p/129244#M48</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;alright, well i figured out that it is catching within the cpu_pause function once it is interrupted. i sort of fixed the problem by changing the following:&lt;BR /&gt;&lt;BR /&gt;while ( (MCF_DTIM2_DTER &amp;amp; MCF_DTIM_DTER_REF) == 0)&lt;BR /&gt;{};&lt;BR /&gt;&lt;BR /&gt;to:&lt;BR /&gt;&lt;BR /&gt;while ( MCF_DTIM2_DTMR !=0 &amp;amp;&amp;amp; (MCF_DTIM2_DTER &amp;amp; MCF_DTIM_DTER_REF) == 0)&lt;BR /&gt;{};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;also, i added a second cpu_pause for the interrupts, though i havn't yet tried to just use 1 function with the alteration. now, i have a new problem though: when i run the debugger in codewarrior (v6.2) both buttons work fine, and they can interrupt each other fine. but when i just run it (no debug) the level 5 edgeport interrupt haults the system. does anyobody have a clue why that would happen&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2006 14:34:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/M5213EVB-interrupt-problem/m-p/129244#M48</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-03-22T14:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: M5213EVB interrupt problem</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/M5213EVB-interrupt-problem/m-p/129245#M49</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;well, I found out that the problem i was having with the board halting was the printf statement. Once I removed that, the system operated fine in both debug mode and 'run' mode.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2006 09:22:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/M5213EVB-interrupt-problem/m-p/129245#M49</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-03-26T09:22:38Z</dc:date>
    </item>
  </channel>
</rss>

