<?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 Interrupt and timer on MCF52235RM in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165823#M5738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some issue about timer and interrupt on a MCF52235RM µC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to blink a LED every second (or ms or µs).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My code (inspirate of &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fforums.freescale.com%2Ffreescale%2Fboard%2Fmessage%3Fboard.id%3DCFCOMM%26message.id%3D2192" rel="noopener noreferrer" target="_blank"&gt;this code):&lt;/A&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;#ifndef __TIMER_H__#define __TIMER_H__voidmcf52235_interrupt_init(uint8 source, uint8 ipl, void (*handler)(void));/* FUNCTION: GPTA_Timer_Init() * * Initialise and enable General Purpose Timer A0 to work like * a PIT. * * PARAM2: Prescaler value - sets the tick frequency to *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (system clock/2) divided by 2^PCSR * * PARAM3: Modulo counter - sets the mumber of ticks per interrupt * * PARAM4: Interrupt handler * * RETURNS: none */#include "MCF52235.h"#define ADDRESS&amp;nbsp;&amp;nbsp; uint32voidGPTA_Timer_Init(uint8 PCSR, uint16 PMR, void (*handler)(void)){&amp;nbsp; uint8 ipl = MCF_INTC_ICR_IL(2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MCF_INTC_ICR_IP(0); // Disable timer A MCF_GPTA_GPTSCR2 = 0; // Set up interrupt handler mcf52235_interrupt_init(44, ipl, handler);&amp;nbsp;&amp;nbsp; // Set modulo count // (= number of ticks per interrupt) MCF_GPTA_GPTC0 = PMR;&amp;nbsp;&amp;nbsp; // Tick frequency = (system clock/2) divided by 2^PCSR MCF_GPTA_GPTSCR2&amp;nbsp; = 0x87;//(uint8)(MCF_GPTA_GPTSCR2_PR(PCSR)); MCF_GPTA_GPTIOS = MCF_GPTA_GPTIOS_IOS0;&amp;nbsp; MCF_GPTA_GPTIE = MCF_GPTA_GPTIE_CI0;&amp;nbsp; // Enable timer A MCF_GPTA_GPTSCR2 = MCF_GPTA_GPTSCR2_TOI; MCF_GPTA_GPTSCR1 = MCF_GPTA_GPTSCR1_GPTEN;}/* FUNCTION: mcf52235_interrupt_init() * * Initialise an interrupt handler for an interrupt source * for INTC0. If the handler is a NULL pointer, then mask * this interrupt. * * PARAM1: Interrupt source (1..62) * * PARAM2: Interrupt level and priority * * PARAM3: Interrupt handler * * RETURNS: none */voidmcf52235_interrupt_init(uint8 source, uint8 ipl, void (*handler)(void)){// Only for user defined vectors in INTC0 if ((source &amp;gt; 0) &amp;amp;&amp;amp; (source &amp;lt; 63)) {&amp;nbsp; // Interrupts should be disabled to avoid vector problems&amp;nbsp; // and to ensure that a spurious interrupt exception can't&amp;nbsp; // be generated.&amp;nbsp; uint8 sysint =(uint8) asm_set_ipl(7);&amp;nbsp; if (handler)&amp;nbsp; {&amp;nbsp;&amp;nbsp; // Set interrupt priority level&amp;nbsp;&amp;nbsp; MCF_INTC0_ICR(source) =(uint8)(ipl &amp;amp; 0x3F);&amp;nbsp;&amp;nbsp; // Set vector&amp;nbsp;&amp;nbsp; mcf5xxx_set_handler(source+64, (ADDRESS)handler);&amp;nbsp;&amp;nbsp; // Clear mask for this handler&amp;nbsp;&amp;nbsp; /*if (source &amp;lt; 32)&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRL &amp;amp;= ~(MCF_INTC_IMRL_INT(source);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MCF_INTC_IMRL_MASKALL);&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp; {*/&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRL &amp;amp;= ~(MCF_INTC_IMRL_MASKALL);&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRH &amp;amp;= ~(MCF_INTC_IMRH_INT_MASK44);//MCF_INTC_IMRH_INT(source)&amp;nbsp;&amp;nbsp; //}&amp;nbsp; }&amp;nbsp; else&amp;nbsp; {&amp;nbsp;&amp;nbsp; // Set vector&amp;nbsp;&amp;nbsp; mcf5xxx_set_handler(source+64, (ADDRESS)handler);&amp;nbsp;&amp;nbsp; // Set mask for this handler&amp;nbsp;&amp;nbsp; /*if (source &amp;lt; 32)&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRL |= MCF_INTC_IMRL_INT(source);&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp; {*/&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRH |= MCF_INTC_IMRH_INT_MASK44;&amp;nbsp;&amp;nbsp; //}&amp;nbsp; }&amp;nbsp; // As you were...&amp;nbsp; //asm_set_ipl(sysint); }}/********************************************************************/#endif&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;My main:&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;/* * main implementation: use this sample to create your own application * */#define __interrupt__&amp;nbsp;&amp;nbsp; __declspec(interrupt)#include "support_common.h" /* include peripheral declarations and more */#include "MCF52235.h"#include "timer.h"#if (CONSOLE_IO_SUPPORT || ENABLE_UART_SUPPORT) /* Standard IO is only possible if Console or UART support is enabled. */#include &amp;lt;stdio.h&amp;gt;#endif__interrupt__voidtimer_handler(void){ MCF_GPIO_PORTUB^=0x01;//Blink LED // Clear interrupt MCF_GPTA_GPTFLG2 = MCF_GPTA_GPTFLG2_TOF; }int main(void){ MCF_CLOCK_SYNCR=0x0705;//PLL bypass MCF_CLOCK_SYNSR=0x80;//External clock systeme&amp;nbsp; GPTA_Timer_Init(5, 65535, timer_handler); mcf5xxx_irq_enable(); MCF_GPIO_PORTUB=0; MCF_GPIO_DDRUB=0x07; while(1) {&amp;nbsp; MCF_GPIO_PORTUB^=0x02;&amp;nbsp; }}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;These code don't work, i can't set time of interrupt (second,milisecond,µs,etc) and when i change value of prescaler, this have no effect &lt;SPAN class="lia-unicode-emoji" title=":confused_face:"&gt;&lt;LI-EMOJI id="lia_confused-face" title=":confused_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for help&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by kedja on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-06-19&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;10:31 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:12:49 GMT</pubDate>
    <dc:creator>kedja</dc:creator>
    <dc:date>2020-10-29T09:12:49Z</dc:date>
    <item>
      <title>Interrupt and timer on MCF52235RM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165823#M5738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some issue about timer and interrupt on a MCF52235RM µC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to blink a LED every second (or ms or µs).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My code (inspirate of &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fforums.freescale.com%2Ffreescale%2Fboard%2Fmessage%3Fboard.id%3DCFCOMM%26message.id%3D2192" rel="noopener noreferrer" target="_blank"&gt;this code):&lt;/A&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;#ifndef __TIMER_H__#define __TIMER_H__voidmcf52235_interrupt_init(uint8 source, uint8 ipl, void (*handler)(void));/* FUNCTION: GPTA_Timer_Init() * * Initialise and enable General Purpose Timer A0 to work like * a PIT. * * PARAM2: Prescaler value - sets the tick frequency to *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (system clock/2) divided by 2^PCSR * * PARAM3: Modulo counter - sets the mumber of ticks per interrupt * * PARAM4: Interrupt handler * * RETURNS: none */#include "MCF52235.h"#define ADDRESS&amp;nbsp;&amp;nbsp; uint32voidGPTA_Timer_Init(uint8 PCSR, uint16 PMR, void (*handler)(void)){&amp;nbsp; uint8 ipl = MCF_INTC_ICR_IL(2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MCF_INTC_ICR_IP(0); // Disable timer A MCF_GPTA_GPTSCR2 = 0; // Set up interrupt handler mcf52235_interrupt_init(44, ipl, handler);&amp;nbsp;&amp;nbsp; // Set modulo count // (= number of ticks per interrupt) MCF_GPTA_GPTC0 = PMR;&amp;nbsp;&amp;nbsp; // Tick frequency = (system clock/2) divided by 2^PCSR MCF_GPTA_GPTSCR2&amp;nbsp; = 0x87;//(uint8)(MCF_GPTA_GPTSCR2_PR(PCSR)); MCF_GPTA_GPTIOS = MCF_GPTA_GPTIOS_IOS0;&amp;nbsp; MCF_GPTA_GPTIE = MCF_GPTA_GPTIE_CI0;&amp;nbsp; // Enable timer A MCF_GPTA_GPTSCR2 = MCF_GPTA_GPTSCR2_TOI; MCF_GPTA_GPTSCR1 = MCF_GPTA_GPTSCR1_GPTEN;}/* FUNCTION: mcf52235_interrupt_init() * * Initialise an interrupt handler for an interrupt source * for INTC0. If the handler is a NULL pointer, then mask * this interrupt. * * PARAM1: Interrupt source (1..62) * * PARAM2: Interrupt level and priority * * PARAM3: Interrupt handler * * RETURNS: none */voidmcf52235_interrupt_init(uint8 source, uint8 ipl, void (*handler)(void)){// Only for user defined vectors in INTC0 if ((source &amp;gt; 0) &amp;amp;&amp;amp; (source &amp;lt; 63)) {&amp;nbsp; // Interrupts should be disabled to avoid vector problems&amp;nbsp; // and to ensure that a spurious interrupt exception can't&amp;nbsp; // be generated.&amp;nbsp; uint8 sysint =(uint8) asm_set_ipl(7);&amp;nbsp; if (handler)&amp;nbsp; {&amp;nbsp;&amp;nbsp; // Set interrupt priority level&amp;nbsp;&amp;nbsp; MCF_INTC0_ICR(source) =(uint8)(ipl &amp;amp; 0x3F);&amp;nbsp;&amp;nbsp; // Set vector&amp;nbsp;&amp;nbsp; mcf5xxx_set_handler(source+64, (ADDRESS)handler);&amp;nbsp;&amp;nbsp; // Clear mask for this handler&amp;nbsp;&amp;nbsp; /*if (source &amp;lt; 32)&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRL &amp;amp;= ~(MCF_INTC_IMRL_INT(source);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MCF_INTC_IMRL_MASKALL);&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp; {*/&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRL &amp;amp;= ~(MCF_INTC_IMRL_MASKALL);&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRH &amp;amp;= ~(MCF_INTC_IMRH_INT_MASK44);//MCF_INTC_IMRH_INT(source)&amp;nbsp;&amp;nbsp; //}&amp;nbsp; }&amp;nbsp; else&amp;nbsp; {&amp;nbsp;&amp;nbsp; // Set vector&amp;nbsp;&amp;nbsp; mcf5xxx_set_handler(source+64, (ADDRESS)handler);&amp;nbsp;&amp;nbsp; // Set mask for this handler&amp;nbsp;&amp;nbsp; /*if (source &amp;lt; 32)&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRL |= MCF_INTC_IMRL_INT(source);&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp; {*/&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_INTC0_IMRH |= MCF_INTC_IMRH_INT_MASK44;&amp;nbsp;&amp;nbsp; //}&amp;nbsp; }&amp;nbsp; // As you were...&amp;nbsp; //asm_set_ipl(sysint); }}/********************************************************************/#endif&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;My main:&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;/* * main implementation: use this sample to create your own application * */#define __interrupt__&amp;nbsp;&amp;nbsp; __declspec(interrupt)#include "support_common.h" /* include peripheral declarations and more */#include "MCF52235.h"#include "timer.h"#if (CONSOLE_IO_SUPPORT || ENABLE_UART_SUPPORT) /* Standard IO is only possible if Console or UART support is enabled. */#include &amp;lt;stdio.h&amp;gt;#endif__interrupt__voidtimer_handler(void){ MCF_GPIO_PORTUB^=0x01;//Blink LED // Clear interrupt MCF_GPTA_GPTFLG2 = MCF_GPTA_GPTFLG2_TOF; }int main(void){ MCF_CLOCK_SYNCR=0x0705;//PLL bypass MCF_CLOCK_SYNSR=0x80;//External clock systeme&amp;nbsp; GPTA_Timer_Init(5, 65535, timer_handler); mcf5xxx_irq_enable(); MCF_GPIO_PORTUB=0; MCF_GPIO_DDRUB=0x07; while(1) {&amp;nbsp; MCF_GPIO_PORTUB^=0x02;&amp;nbsp; }}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;These code don't work, i can't set time of interrupt (second,milisecond,µs,etc) and when i change value of prescaler, this have no effect &lt;SPAN class="lia-unicode-emoji" title=":confused_face:"&gt;&lt;LI-EMOJI id="lia_confused-face" title=":confused_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for help&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by kedja on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-06-19&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;10:31 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:12:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165823#M5738</guid>
      <dc:creator>kedja</dc:creator>
      <dc:date>2020-10-29T09:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt and timer on MCF52235RM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165824#M5739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;If it helps, this is the code I use to blink a heartbeat LED:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;#include "main.h"// *** timer ****************************************************************int volatile ticks;  // incremented by pit0 isr every millisecondint volatile seconds;  // incremented by pit0 isr every second// called by pit0 every millisecondstatic__declspec(interrupt)voidtimer_isr(void){    int halves;    MCF_PIT0_PCSR |= MCF_PIT_PCSR_PIF;    ticks++;    if (ticks%500 == 0) {        halves = ticks/500;            led_set(3, halves&amp;amp;1);        if ((halves&amp;amp;1) == 0) {            seconds++;        }    }}voidtimer_initialize(void){    // enable pit0 timer interrupt    __VECTOR_RAM[119] = (uint32)timer_isr;    MCF_INTC0_ICR55 = MCF_INTC_ICR_IL(SPL_PIT0)|MCF_INTC_ICR_IP(SPL_PIT0);    MCF_INTC0_IMRH &amp;amp;= ~MCF_INTC_IMRH_INT_MASK55;  // pit0    MCF_INTC0_IMRL &amp;amp;= ~MCF_INTC_IMRL_MASKALL;    // configure pit0 to interrupt every 1 ms    MCF_PIT0_PCSR = 0;    MCF_PIT0_PMR = 24000;  // 1 ms @ 48 MHz    MCF_PIT0_PCSR = MCF_PIT_PCSR_PRE(0)|MCF_PIT_PCSR_OVW|MCF_PIT_PCSR_PIE|MCF_PIT_PCSR_RLD|MCF_PIT_PCSR_EN;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:12:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165824#M5739</guid>
      <dc:creator>RichTestardi</dc:creator>
      <dc:date>2020-10-29T09:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt and timer on MCF52235RM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165825#M5740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I would avoid the GPT for generating periodic interrupts. It is more useful for generating waveforms.&lt;BR /&gt;&lt;BR /&gt;The M5223X has 2 PITs, which are designed for this purpose and are very easy to use. Rich's code shows how much simpler it is.&lt;BR /&gt;&lt;BR /&gt;The M5223X also has 4 DMA timers which are very powerful - they can easily be configured to generate periodic interrupts from us region up to many days with very high resolution.&lt;BR /&gt;&lt;BR /&gt;Here are extracts from the user interface for these timer in the uTasker project, which will also simulate these timers to allow easy testing of code:&lt;BR /&gt;&lt;BR /&gt;Eg of configuring a PIT with a single shot interrupt of 3245us - it calls back the user handler test_timer_int() when it fires. It will power itself up and automatically power itself down when finished with its work.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;static void fnConfigurePIT(void){    PIT_SETUP pit_setup;                                                 // interrupt configuration parameters    pit_setup.int_type = PIT_INTERRUPT;    pit_setup.int_handler = test_timer_int;    pit_setup.int_priority = PIT1_INTERRUPT_PRIORITY;    pit_setup.count_delay = PIT_US_DELAY(3245);                          // 3245us delay    pit_setup.mode = PIT_SINGLE_SHOT;                                    // one-shot interrupt    fnConfigureInterrupt((void *)&amp;amp;pit_setup);                            // enter interrupt for PIT1 test}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;Here is an example of using a DMA timer (these are interesting because they can also be used to cause DMA transfers to take place) rather than interrupting..&lt;BR /&gt;In this case it also performs a single shot interrupt with 6345us timeout&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;static void fnConfigure_DMA_Timer(void){    DMA_TIMER_SETUP dma_timer_setup;                                     // interrupt configuration parameters    dma_timer_setup.int_type = DMA_TIMER_INTERRUPT;    dma_timer_setup.int_handler = DMA_timer_int;    dma_timer_setup.channel = 1;                                         // DMA timer channel 1    dma_timer_setup.int_priority = DMA_TIMER1_INTERRUPT_PRIORITY;        // define interrupt priority    dma_timer_setup.mode = (DMA_TIMER_INTERNAL_CLOCK | DMA_TIMER_SINGLE_SHOT_INTERRUPT);    dma_timer_setup.count_delay = DMA_TIMER_US_DELAY(1,1,6345);          // 6345us delay using no dividers    fnConfigureInterrupt((void *)&amp;amp;dma_timer_setup);                      // enter interrupt for DMA timer test}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;To generate periodic interrupts or control output signals the parameters can be simply modified:&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;eg. periodic interrupt:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dma_timer_setup.mode = (DMA_TIMER_INTERNAL_CLOCK | DMA_TIMER_PERIODIC_INTERRUPT);&lt;BR /&gt;&lt;BR /&gt;or an output on its TOUT pin:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dma_timer_setup.mode = (DMA_TIMER_RESTART_ON_MATCH | DMA_TIMER_TOGGLE_OUTPUT);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dma_timer_setup.count_delay = DMA_TIMER_US_DELAY(1,1,(1000000/2/1500)); // 1500Hz signal&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&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;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:12:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165825#M5740</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T09:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt and timer on MCF52235RM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165826#M5741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks a bunch men,&lt;BR /&gt;That was very helpfull for me.&lt;BR /&gt;I have take the Rich T methode (more &lt;SPAN class="definition"&gt;comprehensible &lt;SPAN class="comment"&gt;for me &lt;SPAN&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;BR /&gt;C u later for another issue &lt;SPAN class="definition"&gt;&lt;SPAN class="comment"&gt;&lt;SPAN&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 14:17:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165826#M5741</guid>
      <dc:creator>kedja</dc:creator>
      <dc:date>2008-06-20T14:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt and timer on MCF52235RM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165827#M5742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi again,&lt;BR /&gt;I'm allready back &lt;SPAN&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/SPAN&gt;....&lt;BR /&gt;When i change PMR value (2500 for 1 sec), i obtain some bug when i check with oscillograme&lt;BR /&gt;Representation of oscillogram screen in attachment&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 14:52:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165827#M5742</guid>
      <dc:creator>kedja</dc:creator>
      <dc:date>2008-06-20T14:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt and timer on MCF52235RM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165828#M5743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;It's ok I've fix it!&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 20:03:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interrupt-and-timer-on-MCF52235RM/m-p/165828#M5743</guid>
      <dc:creator>kedja</dc:creator>
      <dc:date>2008-06-20T20:03:39Z</dc:date>
    </item>
  </channel>
</rss>

