How to use CPU timer in Simulink for C2000/TMS320F2837xD

42 次查看(过去 30 天)
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.

回答(1 个)

Supraja
Supraja 2023-7-26
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:
  1. Set the “delay length” function of the delay block to your desired duration or specify a “sample time”.
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 个评论
Lambros
Lambros 2023-7-27
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

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by