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.

TMS320F28035: epwm timer

Part Number: TMS320F28035


hi, I want to use F28035's epwm as a timer. Is there any instruction that can achieve the epwm timer's start, stop, reload and other operations, just like cputimer? Thank you

    CpuTimer1Regs.TCR.bit.TSS = 0;
    CpuTimer1Regs.TCR.bit.TSS = 1;// Make sure timers are stopped
    
    //
    // Reload all counter register with period value
    //
    CpuTimer1Regs.TCR.bit.TRB = 1;

  • z.z,

    it might not be "just like CPUtimer", but it should be similar.

    • You can start and stop the ePWM's time-base counter with TBCTL.CTRMODE. 
    • If you would like to change the period you can adjust TBPRD.
    • If you need to initialize the timer to a value you can write directly to TBCTR.
    • You can also setup an interrupt using ETSEL.INTSEL and ETSEL.INTEN.

    Regards,
    Cody