Synchronize data output with clock pulses.

1 view (last 30 days)
Tom on 28 Mar 2011
Hi. I am using simulink for my project.
How do I pause and hold an uint8 input, so that it can output in a sample time which synchronize with every clock pulses?
I am currently using the Enabled Subsystem with a clock input of 2 period. The input is uint 8, which run infinitely. However, there are missing data at the output at every interval where the clock goes zero.
Urgent. Any reply will be appreciate. Thank you.
Tom on 29 Mar 2011
I am using a digital clock with an output of '1' & '0' to trigger the enable control input of the enabled subsystem with a period of 2.
The input at the input port 1 can be any random input, example a ramp or repeating sequence stairs.
I used a scope to connect to the output port to observe the output results.
For the output port 1, I configured the output when disabled to reset and set the initial output condition to [0].
I am expecting the result to synchronize with every clock pulses. Which means there is no missing data. For every enabled pulses, the input will release a certain amount of data. For example 123 for the first cycle, then 456 for the next cycle. Instead of what I am getting now, which is 123 for the 1st cycle and 789 for the next cycle. The data 456 is missing, since the input in running continuously. Is there any way to pause the input so that it can synchronise with every clock pulse? So that I will not have missing data. Thank you.

Sign in to comment.

Answers (1)

MarkB on 29 Mar 2011
I believe that the issue is with the "Enable" block inside the enabled subsystem. If you double-click on this block, you can access the settings that define how it behaves when the subsystem is disabled. I believe that if you set it to "held" instead of "reset" you will get the behavior that you want.

Community Treasure Hunt

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

Start Hunting!