Can't emit eTimer High Edge interrupt on MPC5604P

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

Can't emit eTimer High Edge interrupt on MPC5604P

471 Views
breee
Contributor I

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.

0 Kudos
1 Reply

392 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Lee,

try to use internal clock as primary clock source, i.e. set CTRL1 = 0x3801

One example that demonstrate Capture feature is given for example here: https://community.nxp.com/message/605249?commentID=605249#comment-605249 

BR, Petr