- Set the “delay length” function of the delay block to your desired duration or specify a “sample time”.
How to use CPU timer in Simulink for C2000/TMS320F2837xD
25 views (last 30 days)
Show older comments
I am using TMS320F28379D (in OP8666 by OPAL RT) and CCS and I run simulink models in real time, using ADC, DO ports etc., and I want to use simulink blocks to generate real time delays of specific duration (e.f., 10usec), to use them as deadtime for generating pulses (I am not using any PWM module). Which is the appropriate simulink block for configuring the Timer settings and also what hardware configuration settings should I make?
Thank you in advance.
0 Comments
Answers (1)
Supraja
on 26 Jul 2023
To introduce real time specific delays to your model you can use “delay block”. This block is used to introduce time delays according to your desired value by following step:
You can also connect this to a “digital output block”, with consistent time delay as the delay block you have connected.
Here is the documentation links attached for further reference:
Delay block:https://www.mathworks.com/help/simulink/slref/delay.html?searchHighlight=delay%20block&s_tid=srchtitle_support_results_1_delay%20block#d124e50722
Digital output block:https://www.mathworks.com/help/supportpkg/freedomboard/ref/digitaloutput.html?searchHighlight=digital%20output%20block&s_tid=srchtitle_support_results_4_digital%20output%20block
For hardware configuration settings, you need to ensure that the target hardware you are using are inline with your desired timing resolution like sample time and clock frequency settings.
Hope this helps!
1 Comment
Lambros
on 27 Jul 2023
Dear Supraja,
Thank you for your reply!
I have thought to use the delay blocks, but before this I have to solve my problem with the frequency of the output signals (observed with hoscilloscope from the digital outputs of the target hardware), as the signals that I am trying to send are not in the frequency that I am using in the Simulink model (based on the Sample Time step).
I have created a Simulink model (attached) to test the clock frequency and the hardware and software interrupt blocks of Simulink. Please see the attached file (Questions.pdf), where I describe my questions; I hope that this will help you understand my issues!
Thank you very much in advance for your time and effort!
Best Regards,
Nena
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!