AnsweredAssumed Answered

Can't emit eTimer High Edge interrupt on MPC5604P

Question asked by Lee Breee on Sep 13, 2017
Latest reply on Sep 15, 2017 by Petr Stancik

hi, I have an issue about the etimer interrupt. We used a MPC5604P to control a BLDC with HALL signals.

I've configured etimer1 as the input of Hall-A, code below.


ETIMER_1.CHANNEL[1].LOAD.R= 0x0000;

ETIMER_1.CHANNEL[1].CNTR.R= 0x0000;

ETIMER_1.CHANNEL[1].CTRL3.R= 0x0F00;

ETIMER_1.CHANNEL[1].FILT.R= 0x0000;

ETIMER_1.CHANNEL[1].CTRL2.R= 0x0000;

ETIMER_1.CHANNEL[1].CMPLD1.R= 0x0000;

ETIMER_1.CHANNEL[1].COMP1.R= 0x0000;

ETIMER_1.CHANNEL[1].CMPLD2.R= 0x0000;

ETIMER_1.CHANNEL[1].COMP2.R= 0x0000;

ETIMER_1.CHANNEL[1].CCCTRL.R= 0x00F1;
ETIMER_1.CHANNEL[1].INTDMA.B.IEHFIE = 1;

ETIMER_1.CHANNEL[1].CTRL.R= 0x4101;

 

and the intc_vec table is

 

(uint32_t)&eTimer1_Ch1_Isr, /* Vector #- 169 interrupt_handler*/
(uint32_t)&eTimer1_Ch2_Isr, /* Vector - 170 interrupt_handler*/
(uint32_t)&eTimer1_Ch3_Isr, /* Vector - 171 interrupt_handler*/

 

and the interrupt handle code

void eTimer1_Ch1_Isr(void)
{
int i=0;
ETIMER_1.CHANNEL[1].STS.B.IEHF = 1;
i++;
LED=~LED;
}

when I rotate the motor to input Hall_A signal, the interrupt seems not woking. 

Anyone could help? better provide a demo code for etimer edge capture interrupt, thanks a lot.

Outcomes