How to setup in C Interrupts for MPC5604B

显示  仅  | 搜索替代 

How to setup in C Interrupts for MPC5604B

941 次查看
Contributor I



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.

标记 (1)
0 项奖励
1 回复

247 次查看
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.




0 项奖励