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.

TMS320F280025: EPWM Event Trigger Count Initial function

Part Number: TMS320F280025

Hi,

what is the exact function of the EPWM Trigger Event count Value

Unfortunately I could not find a fitting description in the data sheets.

When is the initial value set? 

What is the effect of "Force SOCA Trigger Event Count Initial value"?

If the initial value is set, what is the effect to the Event Count? Is the Interrupt generated earlier the higher the initial value is set?

Thanks in advance

  • Hello Stefan,

    You're on the right track! The ET module doesn't start an SOC/interrupt (depending on which section you're configuring- in this case, an SOC) every time one of its event triggers occurs. Instead, it increments a counter register.- When that counter reaches a pre-defined period value, that is when the SOC occurs.

    Setting the initial value for the register does exactly what it sounds like- instead of beginning at 0, the counter begins each cycle at (in your case, according to the image you posted) 1, meaning it takes 1 less trigger event before the SOC occurs.

    When does this initialization happen? Every time there's an ePWM sync event, the initialization value is loaded into the counter, according to the description in the TRM. Or, you can also activate it with a software force! All that checkbox does, as far as I can tell, is run that software force during your system initialization.

    Relevant registers, pulled from your device's TRM:

    • ETSOCPS (Event trigger start of conversion pre-scale) contains the 4-bit counters as well as the 4 bit period values that determine how often an SOC occurs.
    • ETPS (Event trigger pre-scale) enables the above, or if you don't need 4 bits, also contains a 2 bit counter and 2 bit period to do the same.
    • ETCNTINITCTL (Event trigger counter initialization control) enables initialization and also contains the software force bits.
    • ETCNTINIT (Event trigger counter initialization) contains the values the counters are initialized at.

    Hope this answer was able to help,

    Jason Osborn

  • Hello,

    thanks for that explanation.

    All that checkbox does, as far as I can tell, is run that software force during your system initialization.

    That is what I want to do. I would like to initialize the counter once at system initialization. But NOT every sync event.

    The goal is to get a time delay between two SOC´s. So both event counters are counting to 2, but one is initialized with 0 and the other with 1.

    Hopefully this would generate a alternating trigger for SOC-A and SOC-B.

    So the way would be to set one SOC trigger as shown in the image and disable the initialization immediately after startup.

    Or is there a better way?

    Thanks 

  • Hello Stefan,

    I don't believe I see a more intuitive way to do what you're looking for- either disabling initialization or setting the initialization value to 0 after the first software force is the most straightforward way to accomplish this. I will note, I would be careful with the timing of when you do this- I was unable to find documentation regarding what happens if either of these actions is performed during/near a sync event. I would personally input a line disabling it immediately after the software force in the SysConfig-generated board.c file to ensure it's performed at the appropriate time.

    Regards,

    Jason Osborn