How to setup in C Interrupts for MPC5604B

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to setup in C Interrupts for MPC5604B

937件の閲覧回数
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.

タグ(1)
0 件の賞賛
1 返信

243件の閲覧回数
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 件の賞賛