Hi,
I have some problems with programming F28335 chip by Simulink.
I opened the demo c28335 adcpwmasyntest.mdl from Target Support Package TC2, all the setting are default. I build this model, the C code is generated automatically in CCS without any errors and warnings, and was downloaded into the DSP correctly. However, with the scope observing the PWM output, the duty cycle didn't vary according to the ADC output values.
In order to simplify the model, then I revised the ePWM block of this demo:
The time period units still select Clock cycles, Time period source still select Specify via dialog, Time period is still 20480, I set up initial value in CMPA for 10240, CMPA source is set to input port. For this input port I have attached constant block with 5120 value. Counting mode is Up-down, CMPA on CAU Set, CMPA on CAD Clear. I can download this program and run it, but I don't get proper working program: on scope the PWM signal is filled 50% (like initial value=10240/20480), i.e. the PWM duty cycle can not update from the input port, always equal to the initial value. Then I change the input port constant block with other values, but the duty cycle of the PWM signal output from ePWM pin still did change (always equal to CMPA initial value/Time period). I was trying check all options in ePWM block, but I don't find any solution.
Does anybody had similar problem? What am I doing wrong?
About my software and hardware: I have Matlab R2009a, CCStudio 3.3 and F28335 DSP
Best regards!
Jerry