compare match 4 Interrupt-F2812

Started by baha...@hotmail.com October 17, 2011
I am using F2812 chip to implement the following.
1- Generate a symmetric three phase PWM, PWM7-12, using EVB on chip.
2- Map the compare match 4, CMP4, to call a software Interrupt service routine using PIE.
The first task, PWM generation, was successfully done. I have verified the physical hardware output using a scope.
However, for the second part, compare match Interrupt, I couldn’t get the expected output.
The Interrupt was delayed from the moment it should start.
My debug approach was as following.
In CMP4 Interrupt service routine, I set a hardware pin HI and maintain it for 5 micro second so I can monitor it on a scope.
For such configuration, CMP4 Hardware debug pin should go high when PWM7 goes high too.
But PWM7 was leading CMP4 hardware debug pin with big time difference, not dead-band.
Also changing the PWM ratio was only affecting the PWM7 on time period, as expected, but there was no change to the moment where CMP4 occurs.
I don’t know why this delay between the CMP4 interrupt and PWM7 goes Hi happen
Please find below the function I am using to initiate the CMP4 Interrupt and serve it
void CMP4INT_isr_init(void)
//Remap CMP4INT to CMP4INT_isr()
PieVectTable.CMP4INT = &CMP4INT_isr;
//Enable CMP4INT Mask
EvbRegs.EVBIMRA.bit.CMP4INT = 1;
//Reset/enable CMP4INT Flag
EvbRegs.EVBIFRA.bit.CMP4INT = 1;
//Enable PIE CMP4INT in group 4
PieCtrlRegs.PIEIER4.bit.INTx1 = 1;
//enable Interrupt from group 4
IER |= M_INT4;
interrupt void CMP4INT_isr(void)
//Serve the interrupt
// Enable more interrupts from this timer
EvbRegs.EVBIMRA.bit.CMP4INT = 1;
//Reset CMP4INT Flag
EvbRegs.EVBIFRA.all |= BIT1;
//Acknowldge PIE from group 4
PieCtrlRegs.PIEACK.all |= PIEACK_GROUP4;
//Interrupt function
Could you guide me in any error I am doing in either the interrupt configuration or service function which may result in this delay?
thank you in advance.

You can post a message or access and search the archives of this group on DSPRelated.com:

Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group.

About this discussion group:

Archives: http://www.dsprelated.com/groups/c28x/1.php

To Post: Send an email to c...

Other DSP Related Groups: http://www.dsprelated.com/groups.php