Electronic Design

PC's Interrupt Measures RPM

This simple design measures the speed in RPM of a rotating wheel by using the PC’s special BIOS interrupt INT1CH and its printer interrupt IRQ4. An infrared optocoupler mounted on the wheel side senses the wheel rotation and generates clock pulses, which initiate an interrupt to the PC through IRQ4 (see the figure).

Each rotation generates an interrupt that enables the interrupt handler routine written in Turbo “C” (see the listing). The handler software increments a global counter “RPMCOUNT” for each occurrence of IRQ4. The timer handler routine written for Special BIOS interrupt INT1CH increments another global counter “TICKER” for each clock tick of INT1CH. It also monitors the number of revolutions stored in “RPMCOUNT” for each one-second interval. The special BIOS interrupt (INT1CH), which does nothing until you provide a routine for it, automatically occurs 18.2 times per second. INT1CH is invoked by the BIOS timer interrupt after it has updated the time-of-day count.

The variable “RPM” provides number of rotations per minute (RPM) of the rotating wheel by multiplying the variable “RPMCURR” by 60. That’s because the variable “RPMCURR” contains the measurement for a one-second interval. Consequently, this simple design is able to precisely measure RPM of a rotating wheel in the PC environment.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish