How to setup in C Interrupts for MPC5604B

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to setup in C Interrupts for MPC5604B

1,013 Views
Valeriu
Contributor I

Hello

 

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.

Tags (1)
0 Kudos
1 Reply

319 Views
TomE
Specialist II

It all depends on the development environment (build, compiler, linker) and you haven't said what you're using.

 

If you're using CodeWarrior, then search that forum for answers. I searched for "interrupt" in "CodeWarrior for ColdFire and Power" and got 165 matches. If you can't find an answer there, then post there if appropriate.

 

Tom

 

0 Kudos