I am using the C2000 extension on MATLAB 2018b.
I've configured the eCAP block to read the duty cycle of a PWM.
To do so, i divide the 2 outputs generated by the block. For example, with a duty cycle of 0.2 the outputs are 200 and 1000.
The problem is that when you turn off the signal generator, the value obtained by this is the same as the last one.
In the attached image, it can be seen the next cycle: Off --> 0.2 --> 0.5 --> 0.8 --> Off --> 0.8 --> 50
Whenever the generator is working there is noise in the signal, but when it is off, the signal holds the last value and has no noise.
How can I reset the value when it is off?