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.

UCD3138064: How to configure interrupt handler for UCD3138064

Part Number: UCD3138064

For a UCD3138064 part, How can we define an interrupt handler function?

I can not find any examples of how to declare these interrupt handler routines.

Thanks

  • Hi,


    Here it is an example to define the interrupt source.


    void init_interrupts(void)
    {
    TimerRegs.T16PWM2CMP0DAT.all = INTERRUPT_TIMER_VAL; //Threshold to send the pwm low. Approx 10[0]KHz. by spec.64ns clock period
    TimerRegs.T16PWM2CMP1DAT.all = 0xffff; //Threshold to send the pwm high
    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_interrupt();
    disable_fast_interrupt();

    write_reqmask(CIMINT_ALL_PWM2_COMP| CIMINT_ALL_TMR_CAPT0 | CIMINT_ALL_FAULT_MUX); //enable pwm2cmp and DPWM0 interrupt(End of 16th period)(int-priority29)
    write_firqpr (CIMINT_ALL_TMR_CAPT0 | CIMINT_ALL_FAULT_MUX); //DPWM0 interrupt(End of 16th period) is mapped to FIQ

    enable_fast_interrupt();
    enable_interrupt();
    }

    ISR is called when the interrupt is triggered.

    #pragma INTERRUPT(fast_interrupt,FIQ)
    void fast_interrupt(void)
    {
    .......
    }

    If you have Ti EVM source code, you can find similar code.

    Regards,
    Sean