Trying to set external interrupts to zero

Hi,
can anyone help me understand how to set external interrupts to zero.
I am using a dc motor with an optoswitch and displaying the output in rpm on a LCD display. The calculation for rpm uses capture mode register of module zero to capture the interrupts. When the motor stops running it does not display zero.
Any suggestions?

Edwin

Parents
  • Use a timer that will be reset by rpm input (it does not have to be hardware-reset, you can reset the timer in the rpm interrupt routine). If the rpm input is not toggling (motor stopped), your timer will time-out and then you know that your rpm is zero. Set the timer period to be longer than the lowest speed of interest.

    - Dejan

Reply
  • Use a timer that will be reset by rpm input (it does not have to be hardware-reset, you can reset the timer in the rpm interrupt routine). If the rpm input is not toggling (motor stopped), your timer will time-out and then you know that your rpm is zero. Set the timer period to be longer than the lowest speed of interest.

    - Dejan

Children
More questions in this forum