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.
Dear Team,
1. I want to generate a PWM pulse from my own PWM logic, after generating how can I use it for LAUNCHXL-F28379D without affecting the switching frequency. so that I can get the same frequency that is generating through my Matlab model.
2. can I directly use PWM pulse in ePWM block?
Please suggest if there is any other solution for this.
Thanks,
Pratyay
Hi Pratyay,
1. I want to generate a PWM pulse from my own PWM logic, after generating how can I use it for LAUNCHXL-F28379D without affecting the switching frequency. so that I can get the same frequency that is generating through my Matlab model.
What do you mean when you say "my own PWM logic"? Can you describe what you are trying to accomplish? What is the frequency you are using in your Matlab model?
2. can I directly use PWM pulse in ePWM block?
Is this a Matlab question? Can you please elaborate.
Best Regards,
Marlyn
Dear Marlyn,
Thanks for your replay.
I am trying to build a control logic for inverter/converter in MATLAB Simulink and generating pwm pulse at 100khz can I directly get that same pulse from my C2000 board after dumping the MATLAB model?
Is ePWM block is mandatory for getting pwm pulse from c2000 board?
Can we use GPIO pin for getting pwm pulse of same frequency?
Thanks,
Pratyay
Hi Pratyay,
I am trying to build a control logic for inverter/converter in MATLAB Simulink and generating pwm pulse at 100khz can I directly get that same pulse from my C2000 board after dumping the MATLAB model?
Yes, you can generate a 100kHz PWM output on the LAUNCHXL-F28379D.
Can we use GPIO pin for getting pwm pulse of same frequency?
I suppose you could toggle a GPIO at specified rates to get a square output with the same frequency. The launchpad brings out the signals of EPWM1-EPWM6, do you need more EPWM channels?
Best Regards,
Marlyn
Dear Marlyn,
Thanks for your replay.
EPWM1-EPWM6 is sufficient for me but its looks complex while trying to configure it .
so my plan is to generate PWM pulse on MATLAB Simulink and use this same pulse through GPIO pin ..is it possible ?
is t possible to get same frequency from GPIO pin which I am getting from MATLAB model.
Thanks,
Pratyay
Pratyay,
I have reached to MathWorks team to help on this. We should expect response by Monday.
Hi Pratyay,
Preferably, it is good to use the ePWM block in your design over toggling a GPIO pin. While you can toggle GPIO pin at 100KHz from within MATLAB/Simulink, but that will not guarantee other features that are provided by the ePWM block. Like, the ePWM block can interrupt at every cycle to perform the ADC conversion. You may also want to add a dead band which would be challenging in the case of GPIO. So I would suggest using the ePWM block instead as it is easy to configure and also provides other features as discussed above along with the PWM generation. We have many examples around this block:
HTH,
Regards,
Venkatesh C
Thanks Venkatesh,
Thanks for Sharing example, is there any specific tutorial for c2000.
Actually I want to generate some PWM pulse(using my control logic) in MATLAB and dump the same model in C2000 board to get the pulse at same frequency C2000 from hardware. I feel its will be easy if I can use GPIO pin for this purpose but concern is I will get same frequency or not which I am getting from my MATLAB model.
Thanks,
Pratyay
Hi Pratyay,
Yes, you will be able to get the same frequency when you have deployed the model on the C2000 target.
Please let us know if there is a difference and I can take a look.
Regards,
Venkatesh C
Currently I don't have DSO with me , Previously I checked with C2000 piccolo board while I am using GPIO for PWM pulse I got lesser frequency than expected.
Thanks,
Pratyay
Dear Team,
I have the below doubts..pls clarify those.
1. I am generation 100khz pulse through pulse generator in Matlab but while I am seeing through GPIO pin in c2000 getting the pulse of 50 kHz.. using GPIO pin getting PWM pulse of half frequency....why?
for Epwm block for TBPRD calculation(Up-Down mode) while using TBCLK value as 100Mhz getting TBPRD values like 1000 for 50khz frequency and pulse also display same 50khz frequency from C2000 board. One more point, max frequency I can use 100mhz, not 200 MHz, pls confirm
Calculation like,
2. for GPIO pin... D1 and D2 signals are show PWM signals from the Delfino c2000 board. the first GPIO is GPIO19 and the second one is GPIO18. The frequency used (1/1e-05)=100KHz but in output getting as 50khz.
Thanks,
Pratyay
Pratyay,
MathWork team is out of office due to Diwali week. They are back in office on next Monday. Apology for inconvenience.
Hi Pratyay,
I tried the same model for GPIO Toggle. But I was able to see 100KHz frequency (see below picture)
Regarding the ePWM max frequency, you can set the following configuration option to switch between 100Mhz or 200Mhz.
For additional queries please connect directly to MathWorks' tech support.
Regards,
Venkatesh C
OK ..For EPWM block i will check and let you know..
But for PWM through GPIO why its coming 50% for me ..any idea? Have you check with c2000 delfino board?
Thanks,
Pratyay
Dear Venkatesh,
Thank you for ur help.
1. Now the EPWM block is working fine ...getting proper frequency.
2. But still through GPIO getting half of the expected frequency. could u please tell me where I am missing? coz circuit is simple ...any configuration I am missing?
if possible pls share ur model Xls file.
Thanks,
Pratyay