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.

RTOS/TMS320F28379D: conversion of time in seconds into clock cycle of 28379D EPWM module

Part Number: TMS320F28379D


Tool/software: TI-RTOS

Hello everyone

I am using EPWM module of F28379D experimental kit via Simulink interface.

However we can specify EPWM period/ CMPA/CMPB values in seconds, But in order to have more accuracy i am thinking about to specify the EPWM period/ duty cycle values in clock cycles.

Can anybody tell relation between seconds and clock cycle.

For e.g. 100 micro seconds means how many clock cycle of F28379D ?

F28379D has 200MHZ processor.

Is one clock cycle is 1/200 seconds?

Thanks

  • Hi,

    SATWANT SINGH said:
    However we can specify EPWM period/ CMPA/CMPB values in seconds

    This would be very messy, why do you've to do this?

    SATWANT SINGH said:
    Can anybody tell relation between seconds and clock cycle.

    1 CPU clock cycle = 1/200E6 = 5ns.

    Regards,

    Gautam

  • Actually i am struggling with the accuracy, some pwm pulses are missing when i am using time in second.

    The situation is_ i am using CMPA and CMPB value for controlling the EPWMxA for each of 6 EPWM modules ( i.e i am using EPWMxA only for each EPWM module ).
    EPWM Period is 222usec (222us for rising and 222us for falling).
    CMPA and CMPB values reload at counter equal to zero and period. (i.e CMPA and CMPB values for rising and falling edge are different).
    On the other hand simulink model run at sample time of 222usec. and CMPA and CMPB values are updated by simulink model after every 222usec. period.
    when counter of F28379D reaches 0 and period, CMPA/CMPB values are updated by simulink model.
    total 45 switching cycle(i.e 45 rising and 45 falling edges) combines one cycle of output.

    Action qualifier conditions are ok as i have verified logic by simple calculation.

    Now the problem
    # pulses are ok only for few cycles and then some pulses misses for other cycles and then ok.
    # pulses for different EPWM modules should be sychronised.
    # As model saves in flash. when i turn off the dsp and again turn ON, the program saved in flash runs. Now some action qualifier logic reverses. therefore i have to rebuild the model again to get same pulses.

    Thanks