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.

CCS/TMS320F28335: C2000/ TMS320F28335

Part Number: TMS320F28335
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Hi, I want to control the duty cycle of PWM wave using a potentiometer:
1. can I use the example in the control suite 

<h1> ADC Start of Conversion (adc_soc)</h1>

//!
//! This ADC example uses ePWM1 to generate a periodic ADC SOC on SEQ1.

2. How can the potentiometer be controlled?

I am new to this domain and need all the help. Thanks in advance
  • Hi Ramayani,

    You'll have to combine 2 example codes here:
    1. C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_examples_ccsv5\adc_soc
    2. C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_examples_ccsv5\epwm_up_aq

    Set your pot in such a way that knob to one end yields 0V and to the other yields 3V. When ready simply input it to ADC and divide the digital value by 4096 (>>12) which can then be multiplied by the period (TBPRD) value.

    Regards,
    Gautam
  • Hi! I was planning to set the period value in PWM as 1875 (10kHz) for updown mode.
    After going through a few more examples, i wasnted to use the adcseqmode example from control suite to generate a continuous sampling of the input voltage and then use that sampling as the comp value to generate pwm signals. please correct me if i am going wrong anywhwere