I am working on motor control and i am able to read the speed from the Hall sensor using the Capture module in Matlab-Simulink, But when I give stop command to the motor, the last capture value is passed on for my speed calculation. and hence giving a false reading.
For this, I am thinking to use either capture interrupt flag or capture event status register, But I adon't know how to make this value zero so that I can differentiate between fresh capture status.
Hope Somebody can help.