This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/UCD3138: How to set the fast-interrupt in UCD3138A64

Part Number: UCD3138

Tool/software: Code Composer Studio

Hi, Dear colleague

I want to set the fast-interrupt of fault3 with the code , but failed, Could you tell me what's wrong with it?

TimerRegs.T16PWM2CMP0DAT.all =1562;   //40hz 1562;   //Threshold to reset counter - 15.625 mHz/10 KHz.
 TimerRegs.T16PWM2CMPCTRL.all = 2;  //Enables compare 0 (reset) interrupt
 TimerRegs.T16PWM2CNTCTRL.all = 0x00c; //PWM counter is running & enables PWM counter reset by compare action on compare 0
 disable_fast_interrupt(); //make sure fast interrupt is disabled
 disable_interrupt();
// write_reqmask(CIMINT_ALL_PWM2_COMP);    // | CIMINT_ALL_FAULT_PIN);
 write_reqmask(CIMINT_ALL_FAULT_PIN|CIMINT_ALL_PWM2_COMP);//(0x02020000); //enable FAULT_INT and PWM0_INT
 write_firqpr (CIMINT_ALL_FAULT_PIN);                     //(0x02000000); //make them all irqs except FAULT_INT
 enable_fast_interrupt(); //make sure fast interrupt is enabled for OVP shutdown
 enable_interrupt();
  • Erwin, that looks fine so far as it goes, but you also need to code to enable the fault 3 interrupt from the fault 3 side to the interrupt flag register, as well as code to process the interrupt and code to make sure that it doesn't get stuck forever calling the interrupt. 

    Can you show us all of that code as well? 

    The best way to debug that code is to run it without enabling the interrupt, and look at all the bits which indicate the interrupt with the memory debugger.