PWM-triggered CLA in Embedded Coder

6 次查看(过去 30 天)
Hello everyone,
I am trying to use the CLA of the mentioned Launchpad, using Matlab's Embedded Coder.
I want to build up from the example of in which a LED blinks at 1 Hz from the following link.
Yet, the trigger of the CLA routine of this example is software based, and I would like to make it PWM based.
To this end, I added ePWM9, which generates and interruption. Then, I the CLA setting to be triggered by ePWM9. The simulink file is attached.
When I build this routine, I get the error ' Code generation information file does not exist. '. In the compilation report, I see an error saying "CLA_exp5_DWork" is undefined".
Could someone be gentle enough to help me ? Has something been defined wrongly ? It would indeed be very helpful if someone could modify the model proposed by Matlab so that it runs on an PWM-based CLA interrupt.
Thank you very much,
Patricio

回答(2 个)

Venkatesh Chilapur
Venkatesh Chilapur 2020-11-2
Hi,
It is likely that the Class of the simulink parameter Cla_out might not be updated.
It can be updated by following the below steps:
Goto MODELLING tab and open the Data Object Wizard.
If the Class of the parameter is shown as Simulink.Signal, it needs to be changed to tic2000demospkg.Signal by following the below steps:
1. Click on Change Class tab and select customize class lists.
2. Under Signal classes, select tic2000demospkg.Signal and click ok.
3. Now, select the newly added class, tic2000demospkg.Signal for the object Cla_out.
Now, Under Data Stores tab under Code Mappings – C window, ensure that the storage class for Cla_out is updated to Cla1ToCpuMsgRAM as shown below:
HTH,
Regards,
Venkatesh C
  1 个评论
Patricio Peralta
Patricio Peralta 2020-11-2
Hello Venkatesh C,
Thank you for your kind help.
Yet I have to admit that your suggestions did not solve my issue.
The matlab example does work, and I always start from it. It works, and the configuration of Cla_out is already OK. I checked that it was configured as you told me.
Starting from this example, I just want to execute an CLA task by using a ePWM CLATastTrigger box. I believe this approach is preferred over using 'software triggered' CLA tasks.
As I include an ePWM, with enabled interrupt capabilities, and connect it to the subsystem, the exercise does not compile. I did not modify the CLA_out properties, and I checked that these were not modified by the adding of an ePWM module and its corresponding ePWM CLA Task Trigger.
Maybe I am still forgetting something, or my matlab has still some bizarre configuration, but all of the described issues are present in the (non-working) example attached to the first post. To the best of my knowledge, this has the correct 'CLA_out' data configuration. Maybe I forgot to mention that I am using the LaunchXL-F28379D.
Further help would greatly be appreciated, as I would be glad to be able to to exploit the full capabilities of the Delfino Launchpad.
Thank you very much,
Patricio

请先登录,再进行评论。


Venkatesh Chilapur
Venkatesh Chilapur 2020-11-2
Hi,
Please try attached model.
You can get more details on the configurations around RT block from the model 'c28379D_dataintegrity_cla.slx' available at:
HTH,
Regards,
Venkatesh C
  1 个评论
Patricio Peralta
Patricio Peralta 2020-11-23
编辑:Patricio Peralta 2020-11-23
Hello Venkatesh,
Thank you for your explanations and example.
I tested the example attached by you on my Delfino Launchpad. It actually compiles nicely.
I have unfortunately the impression that the GPIO15, which is to be toggled, does not do anything. This I tested with the oscilloscope... Could you verify if it works correctly by you?
Thank you very much ,
Patricio

请先登录,再进行评论。

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by