Effacer les filtres
Effacer les filtres

How to use the PWM counter as source for high resolution ramp or triangular functions?

1 vue (au cours des 30 derniers jours)
Hello,
I am using the f28379d launchpad and the "Embedded Coder Support Package for Texas Instruments C2000 Processors". I would like to use the value of the pwm counter inside the code as a high resolusion ramp or triangular function without adding more more code lines (decreasing the execution time of the code). Could anyone help me with how to get to the register and how to use its value inside the simulink environment?
Thank you in advance and best regards!
Ahmed.

Réponse acceptée

Poorna
Poorna le 29 Jan 2024
Hi Ahmed Salem,
I see that you want to access the value of the PWM counter in your Simulink model.
The “Embedded Code Support Package for Texas Instruments C2000 Processors” currently “C2000 Microcontroller Blockset” has the “Memory Copy” block which can be used to copy data from and to processor memory.
By providing the address of the PWM counter as input to the “Memory Copy” block you can get the value of the counter and use it in your model.
To know more about the “Memory Copyblock refer to the following documentation:

Plus de réponses (0)

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by