MATLAB: Modify Duty Cycle of ePWM Using DMA

c2000callback scriptepwmexample

Hello everyone,
I'm using the example which is provided by Mathworks. Although everything works fine, I want to modify some values myself and add extra signals. The problem is a script is working on the background to calculate several values. This script is a so called callback script which should be found in the m-file: |sineTableCalculation.m|. When I search in the example I don't find this m-file. So my question is of course where can I find this script? In the example this explanation was given:
% The example consists of a model and a callback script, which is
% initialized when the model is opened. The callback script
% (|sineTableCalculation.m|) generates a sine wave of 500 samples, and then
% scales the sine wave to the range of zero to the value of the ePWM period
% register.
The example also works for only one phase, so can I use this script also for a second and third phase?
The software I'm using is MATLAB & SIMULINK R2018b and the Embedded Coder Support Package for Texas Instruments C2000 Processors.
Thanks in advance!

Best Answer

Hi,
Please can you run the command at the command prompt:
>>which sineTableCalculation.m
This will give you the path to the file.
The example demos for single phase signal to help user understand aspects of DMA configurations and how to use the DMA with other peripherals like ePWM. You can scale upon this idea for your application needs.
Regards,
Venkatesh C