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.

How to Plot time base control (TBCTL) signal on Graph window

Other Parts Discussed in Thread: TMS320F2808

Board=TMS320F2808

##
// Case 1: Time-Base Control
EPwm1Regs.TBPRD = 600;                                                                 // Period = 2x600 TBCLK counts
EPwm1Regs.TBPHS.half.TBPHS = 0;
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;    // Symmetric counter mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE;
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO;
// Case 2: Compare Control
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;         // load on CTR=Zero
// Case 3: Action-qualifier Control
EPwm1Regs.AQCTLA.bit.CAD = AQ_SET;                                        // set actions for EPWM1A
EPwm1Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm1Regs.CMPA.half.CMPA = 300;                                                // Set duty for EPWM1A

After execution of above 3 cases EPwm1Regs generate a PWM signal w.r.t GPIO pin on Oscilloscope window.

##
But how to plot the signal generated only in Case 1: Time-Base Control.

Other then case: 1 i.e. case: 2 and case: 3 helps to generate PWM signal by compared value CMPA=300 with the TBPRD=600 value.
Counter mode (CTRMODE) is UPDOWN i.e. starting point 0.000 to 600 then 600 to 0.000.

  • Hi Asim,

    You won't be able to plot TBCTL on the Graph. Any specific parameter in TBCTL you were interested in?

    Regards,
    Gautam
  • Hii Gautam,

    --------------------------You won't be able to plot TBCTL on the Graph. Any specific parameter in TBCTL you were interested in?---------------------------

    The objective of Case:1 to generate a Triangular wave by using the bits TBPRD=600 & CTRMODE=TB_COUNT_UPDOWN and i want to plot the
    triangular either on Oscilloscope or Single time graph.

  • Understand. You can read TBCTR value then to a variable and plot it on the graph. But again as Graph refresh rate is quite slower than variable update rate... you'll not be able to observe the triangular wave. So outputting this value through a DAC will give you a smooth waveform on DSO.
  • Gautam,

    ###

    -------------------------------You can read TBCTR value then to a variable and plot it on the graph------------------------------------------------------------

    We set properly the "Acquisition Buffer Size", then it may be triangular on the graph window seen perfectly??? if so, what will be the "Acquisition Buffer Size" value?

    ###

    -------------------------------So outputting this value through a DAC will give you a smooth waveform on DSO---------------------------------------------

    how will do this, i am not getting properly???

  • asim kumar dey said:
    We set properly the "Acquisition Buffer Size", then it may be triangular on the graph window seen perfectly??? if so, what will be the "Acquisition Buffer Size" value?

    Asim, still I don't feel it would be possible but you can give it a try though.

    asim kumar dey said:
    how will do this, i am not getting properly???

    You can feed digital TBCTR values to an external DAC which can further be connected to DSO.

    OR

    You can try this:

    Regards,

    Gautam

  • Thank you Gautam,

    Still i'm not clear, if have any further solution please suggest me or you can contact with TI community of this problem.
    Its me very importance to get the result.
  • What is not clear? The pdf is very clear about the DAC implementation.