<?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: 5213 DTIM3 - Having issues with creating/Start interrupt in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143046#M2646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks for the information( good catch! ), but I still cannot get my interrupt dtim3 to kick.&amp;nbsp; I'm doing asm(move.w #0x2000,SR) in main before I call timer_init.&amp;nbsp; I have in my vector.s file :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;#define __tmrISR&amp;nbsp;&amp;nbsp;_tmrISR&lt;/DIV&gt;&lt;DIV&gt;.extern _tmrISR&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;vector022:&amp;nbsp; .long&amp;nbsp;&amp;nbsp; _tmrISR&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Code :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;MCF_INTC_ICR22 |= MCF_INTC_ICR_IL(6) | MCF_INTC_ICR_IP(3);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;MCF_DTIM3_DTRR = ( SYS_CLK_KHZ / PRESCALER / TIMER_RATE ) - 1;&lt;BR /&gt;&amp;nbsp;MCF_DTIM3_DTMR = ( (uint16) ( PRESCALER - 1 ) &amp;lt;&amp;lt; 8 ) + 0x001b;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;MCF_INTC_IMRH = 0xffffffff;&lt;BR /&gt;&amp;nbsp;MCF_INTC_IMRL = 0xffbffffe;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Do you have any thoughts on this ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Geoffrey&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jan 2007 03:35:57 GMT</pubDate>
    <dc:creator>geoffrey</dc:creator>
    <dc:date>2007-01-18T03:35:57Z</dc:date>
    <item>
      <title>5213 DTIM3 - Having issues with creating/Start interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143044#M2644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello !&amp;nbsp; I have been working a project that requires and isr for dtim3.&amp;nbsp; &lt;SPAN style="font-size: 2;"&gt;I'm trying to setup an interrput for dtim3. I have added my isr to vector 22 in the vector.s file.&amp;nbsp;Here's the&amp;nbsp;code :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MCF_INTC_ICR22 |= MCF_INTC_ICR_IL(3) | MCF_INTC_ICR_IP(3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MCF_DTIM3_DTRR = ( SYS_CLK_KHZ / PRESCALER / TIMER_RATE ) - 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MCF_DTIM3_DTMR = ( (uint16) ( PRESCALER - 1 ) &amp;lt;&amp;lt; 8 ) + 0x001b;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MCF_INTC_IMRH = 0xfff7fffe;&lt;BR /&gt;&lt;BR /&gt;I'm lost on this. Code&amp;nbsp;someone please look at this and tell me what I'm doing wrong.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;Geoffrey&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2007 10:29:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143044#M2644</guid>
      <dc:creator>geoffrey</dc:creator>
      <dc:date>2007-01-17T10:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: 5213 DTIM3 - Having issues with creating/Start interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143045#M2645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;One thing that looks wrong is the interrupt mask in IMRH/IMRL.&lt;BR /&gt;&lt;BR /&gt;The DMA Timer 3 interrupt is number 22, so you need to clear bit 22 in IMRL (together with bit 0, the Mask-All bit). This would mean:&lt;BR /&gt;&lt;BR /&gt;IMRH = 0xffffffff;&lt;BR /&gt;IMRL = 0xffbffffe;&lt;BR /&gt;&lt;BR /&gt;You also need to make sure that the processor's main Status Register (SR) doesn't mask out interrupts.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2007 22:45:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143045#M2645</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2007-01-17T22:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: 5213 DTIM3 - Having issues with creating/Start interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143046#M2646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks for the information( good catch! ), but I still cannot get my interrupt dtim3 to kick.&amp;nbsp; I'm doing asm(move.w #0x2000,SR) in main before I call timer_init.&amp;nbsp; I have in my vector.s file :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;#define __tmrISR&amp;nbsp;&amp;nbsp;_tmrISR&lt;/DIV&gt;&lt;DIV&gt;.extern _tmrISR&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;vector022:&amp;nbsp; .long&amp;nbsp;&amp;nbsp; _tmrISR&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Code :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;MCF_INTC_ICR22 |= MCF_INTC_ICR_IL(6) | MCF_INTC_ICR_IP(3);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;MCF_DTIM3_DTRR = ( SYS_CLK_KHZ / PRESCALER / TIMER_RATE ) - 1;&lt;BR /&gt;&amp;nbsp;MCF_DTIM3_DTMR = ( (uint16) ( PRESCALER - 1 ) &amp;lt;&amp;lt; 8 ) + 0x001b;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;MCF_INTC_IMRH = 0xffffffff;&lt;BR /&gt;&amp;nbsp;MCF_INTC_IMRL = 0xffbffffe;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Do you have any thoughts on this ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Geoffrey&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 03:35:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143046#M2646</guid>
      <dc:creator>geoffrey</dc:creator>
      <dc:date>2007-01-18T03:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: 5213 DTIM3 - Having issues with creating/Start interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143047#M2647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;You could try taking a look at an application called ColdFire Init (or CFInit). It's a GUI application which runs on Windows. It allows you to configure a processor graphically and then writes the C code for you.&lt;BR /&gt;&lt;BR /&gt;For the M5213EVB, CFInit even includes the ability to generate a sample interrupt handler for the DMA timer, and can generate a CodeWarrior project for you.&lt;BR /&gt;&lt;BR /&gt;The URL is:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.microapl.co.uk/CFInit/cfinit_main.html" rel="nofollow" target="_blank"&gt;http://www.microapl.co.uk/CFInit/cfinit_main.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 22:08:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143047#M2647</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2007-01-18T22:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: 5213 DTIM3 - Having issues with creating/Start interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143048#M2648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Here is a small extract of code to do a single shot hardware timer delay in ms. It originates from the uTasker project. It is used in its normal context (this is a snippet from it) to control multiple global hardware timers [the DMA timers in the Coldfire are in fact very good and enable single delays of up to about 17min with us resolution]. They are also used for the in-built uNetwork protocol which allows distributed processing in a LAN based network - a fast network protocol is implemented with the hardware timer managing retransmissions after a few ms in case of message loss.&lt;BR /&gt;&lt;BR /&gt;You may see something which you need to solve your problem.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark Butcher&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Note the define for INTERRUPT_LEVEL_4 is 0x04 shifted by three to the left - the shift left sign got lost when posting!&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;
#define DTIM3_VECTOR        0x56
#define INTERRUPT_LEVEL_4   (0x04  3)
#define INTERRUPT_PRIORITY_1 0x1
#define DTIM3_PIF_INT_L     0x00400000
#define MASK_ALL_INT        0x00000001
#define BUS_CLOCK           (60000000)
#define DMA_TIM_EVENT_CAP   0x0001
#define DMA_TIM_EVENT_REF   0x0002
#define BUS_CLOCK_16        0x0004
#define DMA_TIM_RESTART     0x0008
#define ORRI                0x0010
#define ENABLE_DMA_TIMER    0x0001

static __interrupt__ void _hwtimer_interrupt(void)
{
  DTRR3 = 0;                      // clear reference to indicate not in use
  DTER0 = DMA_TIM_EVENT_REF;      // reset interrupt request flag
  // Do stuff here
  // ..
}


// Start a single short hardware timer for a delay in ms units
//
externt void fnStartDelay(unsigned long ulMilliSeconds)
{
    __VECTOR_RAM[DTIM3_VECTOR] = (unsigned long)_hwtimer_interrupt;  // enter the interrupt routine
    IC_ICR_0_22 = (INTERRUPT_LEVEL_4 | INTERRUPT_PRIORITY_1);        // define interrupts level and priority
    IC_IMRL_0 &amp;amp;= ~(DTIM3_PIF_INT_L | MASK_ALL_INT);                  // unmask interrupt source

    DTRR3 = (ulMilliSeconds * ((BUS_CLOCK / 16 / 1000));             // set ms unit compare rate (max about 19 minutes)
    DTER3 = (DMA_TIM_EVENT_CAP | DMA_TIM_EVENT_REF);                 // Clear possible events

    DTMR3 = (BUS_CLOCK_16 | DMA_TIM_RESTART | ORRI | ENABLE_DMA_TIMER); // Bus clock / 16, enable interrupt and enable timer (again)
}
&lt;/PRE&gt;&lt;P&gt;Message Edited by mjbcswitzerland on &lt;SPAN class="date_text"&gt;2007-01-25&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;12:50 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/5213-DTIM3-Having-issues-with-creating-Start-interrupt/m-p/143048#M2648</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T08:43:19Z</dc:date>
    </item>
  </channel>
</rss>

