I am using the TRK-MPC5634M board and Codewarrior to test an output compare.
I need to know when the OC is done, so I can check some other things.
eTPU->CHAN[0].SCR.B.CIS indicates that the interrupt has fired in the ETPU.
What am I missing in order to route the interrupt back to the processor?
Thanks
partial below
void main(void)
{
init();
test();
while(1){};
}
void init(void)
{
etpuInit();
INTC_InitINTCInterrupts();
INTC_InstallINTCInterruptHandler(etpu_0_ISR, 68, 5); // interrupt for ETPU_0 (68)
fs_etpu_interrupt_enable(0);
fs_etpu_clear_chan_interrupt_flag(0);
INTC .CPR.R = 0;
asm(" wrteei 1");
}
void test(void)
{
SIU .GPDO[ETPU_A1_PIN].R ^= 1; // toggle output so I can see start
fs_etpu_oc_init_immed(0, // channel
FS_ETPU_PRIORITY_HIGH, // priority
FS_OC_MATCH_TCR1, // match timebase
1000, // offset1
FS_ETPU_OC_PIN_HIGH_CAPTURE_TCR1, // pin action
10000, // offset2
FS_ETPU_OC_PIN_LOW_CAPTURE_TCR1, // pin action
FS_ETPU_OC_INIT_PIN_NO_CHANGE); // init pin
fs_etpu_clear_chan_interrupt_flag(0);
}
void etpu_0_ISR(void)
{
SIU .GPDO[ETPU_A1_PIN ].R ^= 1;
fs_etpu_clear_chan_interrupt_flag(0);
}