How to use the PWM counter as source for high resolution ramp or triangular functions?
1 view (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Poorna
on 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 Copy” block refer to the following documentation:
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!