Having Issue Generating Correct PWM signal with C2000 microcontroller TMS320F280002x launch Pad

19 views (last 30 days)
I have tried to flash the board with LED blicking and it worked perfectly. Then I started trying flash the board with some PWM signal. When I use 1kHz (Timer period: 0.001s), it will show an error "The timer period value for PWM module ePWM1 must be a floating-point scalar between 0.0 and 0.000655350.", and gives me noice signal.
So I tried with 2kHz (Timer period: 0.0005s), it was built successfully, but it gives me 1kHz signal when I observed from oscciliscope.
After that, I tried anything that is greater than 2kHz, simulink will built successfully but when I check the oscciliscope it would gives noice signal.
I have tried to change the timer period unit from second to clock cycle and it still having the same issue. I also change 2 different occiliscopes as well.
Can anyone guild me to solve this issue? Thank you for your time.

Answers (1)

Ganesh Thambhahalli Satyen
Edited: Ganesh Thambhahalli Satyen on 7 Sep 2023
Hi Yun,
I understand that you are trying to flash a C2000 microcontroller board with a PWM signal and are not seeing expected results.
Based on the images shared by you I have the following observations and suggestions:
  1. As per the images of the “ePWM” block configuration, the “Counting Mode” is set to “Up-Down” mode. In this mode, the signal will stay high for the timer period set by you followed by an equal period, causing the total signal period to double and hence frequency to halve. On changing the mode to either “Up” or “Down”, you will be able to observe a PWM signal of the timer period you have set. For more information on “Counting Mode”, you may refer to the following MathWorks documentation link: https://mathworks.com/help/ti-c2000/ref/c280xc2802xc2803xc2805xc2806xc2833xc2834xf28m3xf2807xf2837xdf2837xsf2838xf28004xf28002xf28003xepwm.html#mw_78a0f9f0-70ee-45d1-b9d8-a7f455c085a3
  2. By default, in the “Counter Compare” tab of the “ePWM” block configuration, the compare A register(CMPA) parameters are set to the values in the following image: You can try reducing the “CMPA value” to a lower value ( say 3200), or you can change the “CMPA units” to “Percentages” and proceed to give the duty cycle in percentage. For more information on “Counter Compare”, you may refer to the following MathWorks documentation link: https://mathworks.com/help/ti-c2000/ref/c280xc2802xc2803xc2805xc2806xc2833xc2834xf28m3xf2807xf2837xdf2837xsf2838xf28004xf28002xf28003xepwm.html#mw_c497cafe-fd43-47cc-a91b-4ccfeea46bca
Hope this helps.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!