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.

TMS320F28379D: tms320f28379d

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

based on some input condition i am executing some command in if loop .now i want some delay in the execution of the condition .How to do this in 

  • Jahangeer,

    if you are using C2000Ware DriverLib, then you can use SysCtl_delay(uint32_t count);

    if you are using bitfield based code, then you can use something like below:

    #define SYSCTRL_CLKSRCCTL1_DELAY  asm(" RPT #250 || NOP \n RPT #50 || NOP")

    Regards, Santosh

  • this my code i want to put some delay rising edge is detected

    if(GpioDataRegs.GPBDAT.bit.GPIO32 == 1) // Data Register for this pin--Here rising edge is detected -this code works for Positive half cycle


    {

    EALLOW;
    EPwm1Regs.TZFRC.bit.OST = 1; // Force a one shot trip
    EPwm1Regs.TZCTL.bit.TZA = 3; // Do nothing
    EPwm1Regs.TZCTL.bit.TZB = 3; // Do nothing
    EPwm3Regs.TZFRC.bit.OST = 1; // Force a one shot trip
    EPwm3Regs.TZCTL.bit.TZA = 3; // Do nothing
    EPwm3Regs.TZCTL.bit.TZB = 3; // Do nothing

    EPwm2Regs.TZFRC.bit.OST = 1; // Force a one shot trip
    EPwm2Regs.TZCTL.bit.TZA = 1; // Force EPWM2A to a high state
    EPwm2Regs.TZCTL.bit.TZB =1; //Force EPWM2B to a high state

    EPwm4Regs.TZFRC.bit.OST = 1; // Force a one shot trip
    EPwm4Regs.TZCTL.bit.TZA = 1; // Force EPWM2A to a high state
    EPwm4Regs.TZCTL.bit.TZB =1; //Force EPWM2B to a high state


    EDIS;
    EPwm2Regs.TBCTR = 0X0000;
    EPwm4Regs.TBCTR = 0X0000;
    EPwm1Regs.CMPA.bit.CMPA = 5000;
    EPwm1Regs.CMPB.bit.CMPB = 5000;
    EPwm3Regs.CMPA.bit.CMPA = 5000;
    EPwm3Regs.CMPB.bit.CMPB = 5000;

    }

  • Did you check the dead-band example:

    C:/ti/c2000/C2000Ware_4_02_00_00/device_support/f2837xd/examples/cpu1/epwm_deadband