Hi, I want to generate a single pulse as well as a double pulse with different pulse width using Simulink? Pls advise me how to achieve it?
Many thanks!
Joey
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi, I want to generate a single pulse as well as a double pulse with different pulse width using Simulink? Pls advise me how to achieve it?
Many thanks!
Joey
Please refer to the FAQ for any simulink related queries
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/484814
If there is something specific to Simulink (and not related to our device), please approach mathworks customer support.
Hi,
Forget about the Simulink. Pls advise me how to create a single event which can produce a single pulse with the device if possible.
Thanks
Joey,
How do you want the pulse, or pulses, spaced?
Are the pulses a one time event, or will they happen with a regular period?
Are you planning to have a fixed period?
If you are having pulses with a reoccurring period, its best to use a PWM. It is OK to have a variable frequency too, this can be easily done with the PWM. Its typically best to have one pulse per PWM period, having more than one pulse is difficult. Having less than one pulse per PWM period is OK, so if you need multiple pulse, it may be best to increase your PWM's period.
if the pulses are not reoccurring we can talk about methods of doing that, which could be through a GPIO or a PWM that will be reconfigured in its ISR.
Regards,
Cody
Regards,
Cody
Hi, Cody
Thanks for your reply.
I hope the pulse is one time event. Pls advise me how to realise it.
Thanks
Please configure the PWM as desired. You can use the CMPx events to determine the width of your pulse and your PWM period can be any number longer than your pulse width.
Inside of the PWM's Period ISR disable your CMPx events and set them to drive your PWM output equal to zero or whatever your preferred safe state is.
If you don't want to use the PWM module this can be done with GPIO toggles and CPU timers.
Regards,
Cody