AnsweredAssumed Answered

How to setup in C Interrupts for MPC5604B

Question asked by Valeriu Balaban on Nov 15, 2011
Latest reply on Nov 15, 2011 by TomE



I have TRK-MPC5604B rev. B board and i try to work with interrupts from C. 

#include "FREESCALE_CUP.h"vuint8_t l = 0;void SystemTimerInterrupt0(){    if(l){        l = 0;        SIU.GPDO[68].R = l;    }else{        l = 1;        SIU.GPDO[68].R = l;    }}int main(void) {    setup();    // Config LED1 pin as output    SIU.PCR[68].R = 0x0220;    // Configure system timer    STM.CH[0].CMP.R = 1 << 30;    STM.CH[0].CCR.R = 0x01;     STM.CR.R = 0x01;         // Instal interrupts    INTC_InstallINTCInterruptHandler(SystemTimerInterrupt0, 30, 1);    INTC_InitINTCInterrupts();        // wait    while(1){ }    return 0;}

 In this program setup function initialize the hardware and system clock to 64Mhz. When the value match in comare register the interrupt bit is set but it does not execute my function.


What i'm doing wrong?


Thank you.