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 generate a 50Hz signal with a ePWM bloc?

Other Parts Discussed in Thread: CONTROLSUITE

Hello everyone,

I have a problem, I'm trying to generate a square wave signal with a ePWM bloc wich has for frequency 50Hz and I'm not successing.

I'm using Matlab Simulink and the right ePWM bloc, but with the formula: TBCLK = SYSCLKOUT / (HSPCLKDIV × CLKDIV), I'm not able to generate a 50Hz signal.

I know we can generate this signal, could someone help me or just give me advice?

I don't know how the timer period function, I've written 64000 for the "timer period", but I don't know if it use the DSP's clock timer? And if it use it, what is this clock timer?

Thank you!!

  • this frequency is too low. u can't get 50Hz by configuring the PWM register to get the signal. try to use timer ISR with GPIO toggle to get this kinda low frequency signal. 

  • There are other ways to generate waveforms and it is possible to generate 50 Hz waveform using a 28x C2000 ePWM blocks. Have you checked out the signal generation library? There should be examples of generating different waveforms. You can use one of those waveforms to toggle a GPIO at 50Hz to obtain a square wave.

  • Hi, Where can I find this signal generation library ?

     

    Thanks.

  • Install Control Suite

    select signal generation library in the installation steps,

    www.ti.com/controlsuite

    the library is installed at

    controlSUITE\libs\dsp\SGEN

  • I'm beginner on CC Studio. I have TI C2000 (F28335 Delfino). I want to generate square waveform PWM signals.

    Is there anything that I should add to this library? How can I generate PWM by using this library?

     

    Thanks.

  • for generating high frequency PWM waveform. there is example code in /tidcs or /controlSUITE and you don't need to use this library. for the frequency as low as 50Hz (i think the PWM module can not reach such low frequency directly), you can use a constant high frequency (generated by PWM module as in the exmaple code) as interrupt source and make a divider on your own or you can use timer ISR as counter. whatever you like.  if you want to change duty cycle, your code would be a little bit complicated,

    otherwise use the example code associated with that library. you might need to spend a little time to understand what those documents are talking about. what i suggest is using the example code given by /tidcs folder or /controlSUITE, play with that, at first get relatively high frequency PWM and able to change the duty cycle as you wish. then try to decrease it to low frequency such as 50Hz signal.

  • I use the example codes in TI teachingrom ssqc019, in lab7 and I can observe my PWMs on osilloscope.

    However, I cant drive motors when I connect TI with motors. I can only drive when motors ground is connected to osilloscope ground. What could be problem?

    Thanks.