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.

TMS320F28075: Valley switching

Part Number: TMS320F28075


The 1/4 of period delay mention blow.

Is the value stored in CNTVAL already multiplied by 1/4?

  • Hi Wei lun,

    No, CNTVAL captures only the period(in this case, or the range between StartEdge and StopEdge in general). If you select 1/4, the calculated result(1/4*CNTVAL) will be put in the HWVDELVAL. Thanks.

    Regards,
    Chen
  • Thanks for your reply.

    Now I use the function generator to generate a 1MHz sine wave in CMPSS module. And setup EPWM8 module TBPRD=200(500kHz),count up mode. Edge Capture Trigger source select CNT_zero, STARTEDGE=1, STOPEDGE=2,

    So theoretically, when CNT_zero is triggered twice,edge capture stop counting and the CNTVAL=200 (500 Hz), but now is 50 (125 Hz).

    My program settings are attached below, does any setting were ignored?

    I use the Piccolo F280049 control CARD with 120HSEC connector develop kit now.

  • Hi weilun,

    Now I use the function generator to generate a 1MHz sine wave in CMPSS module.

    What do you mean by generating 1MHz size wave in CMPSS module? Are you setting it as one of the input to the CMPSS?

    So theoretically, when CNT_zero is triggered twice,edge capture stop counting and the CNTVAL=200 (500 Hz), but now is 50 (125 Hz).

    Selecting CNT_zero means Capture sequence is triggered by CNT_zero event. The edge capture stop counting when the it hits the second edge. In your question, I am pretty sure where and when those edges will appear. Can you draw a pic about the function you would to realize?

    Regards,

    Chen

  • Yes,I setting it to the CMPSS2_HP1.

    My idea and program are shown below.

    I already check the CMPSS output is a 1MHz squre wave.

    I think VCNTVAL should be 200(500kHz), but now VCNTVAL = 50.

    Note: I used the CCS Expressions window to check EPwm8Regs.VCNTVAL value

    Thanks for your help

  • Hi Wei lun,

    I think you misunderstand one point:

    According to the definition in the appnote and TRM:

    5. Select the start edge that will indicate the start of capture for oscillation period measurement
    (VCNTCFG[STARTEDGE]). This is where the 16-bit counter starts counting.
    6. Select the stop edge (VCNTCFG[STOPEDGE]) that will indicate the edge at which the 16-bit counter
    stops counting. The captured counter value (CNTVAL) provides oscillation period information.
    • The STOPEDGE value must always be greater than STARTEDGE value.

    The CNTVAL captures the period between startedge and stopedge not the period between startpoint and endpoint of Capture sequence(which is 500 in you case). However, I expect it to be 100 because you set the rising edges.

    There is a independent counter in edge filter block. In you example, upon occurrence of the trigger event, the edge filter is reset and starts counting from zero "upon occurrence of the STARTEDGE".

    Can you check you settings again or change the rising edge settings to see if there is anything missing there.

    Regards,
    Chen
  • Thanks for your help!!
    I got the point~~