Generate interrupt with eTPU

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

Generate interrupt with eTPU

2,504 Views
tudh
Contributor I
Dear all,
    Please help me to generate an interrupt with eTPU.
    I'm working with eTPU and I still can't generate an interrupt with eTPU. What I have done to generate an interrupt on channel 6 is that:
        in main function :
            ETPU.CHAN[6].CR.R = 0x80000000;  //enable interrupt
            INTC.PSR[74].R = 0x09;           //eTPU_A Channel 6 Priority is: 9

        in etpu code:
            FallingMatch:
                SetChannelInterrupt();       //generate interrupt
                ClearMatchALatch();
                ....
            RisingMatch:
                SetChannelInterrupt();       //generate interrupt
                ClearMatchBLatch();
                ...


    I have also tried with these in main function, but the reaults are also the same:
            ETPU.CHAN[6].CR.B.CIE = 1
            ETPU.CIER_A.B.CIE6 = 1
I have checked the interrupt vector table and interrupt handler and they are OK.
So is it enough or I miss something to generate an interrupt ? If I missed something, please help me with this.
Thanks so much,
tudh

0 Kudos
Reply
3 Replies

1,119 Views
mr_venkatarao
Contributor I
in CR you need to select function, paramater base address..
 
 
in micro code..
 
 
oc(uc para1,uc para2)
 
 if (hsr ==                   )
 
{
 
sm_st
....
.....
enable event handlng
}
 
 
else if (m==1)
 
para1 = para1+100; // this generates interrupt for every 100 * timer rsulotion
generate interrupt;
 
}
 
0 Kudos
Reply

1,119 Views
mr_venkatarao
Contributor I
Yes, the interrupt will be generated continously for every (100*timer resolution)... if timer resolution is 1us then interrupt occurance is for every 1msec.
 
Sry it is not possible to send you project.. net systems are isolated in our company.
 
But i suggest you to find example code in for PWM generation in METROWERKS installation path ....codewarrior_example/multicore project.
In that code interrupt willl be genrated for raising match and falling match. If u set sm_st then interrupt will generate for evry falling match or rising match. Or simply make comment for  .cir command in one of entry point for rising mathc or in falling match. 
 
 i think this will help you..
 
 
 
0 Kudos
Reply

1,119 Views
tudh
Contributor I
Dear power PC,
    Thank you so much for you help.
    I have added EnableEventHandling() to my previous code, and when I checked on Debuger, the interrupts were continuously generated, but the interrupt handler couldn't be executed. Maybe there was some problem with the interrupt vector table and interrupt handler. However, other interrupt handlers using the same mechanism (like eDMA interrupt) still worked normally.
    So I'll really appreciate if you can give me an sample project using interrupt from eTPU for reference.
Thanks so much,
tudh
0 Kudos
Reply