PC's Interrupt Measures RPM

Feb. 22, 1999
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...

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.

Sponsored Recommendations

The Importance of PCB Design in Consumer Products

April 25, 2024
Explore the importance of PCB design and how Fusion 360 can help your team react to evolving consumer demands.

PCB Design Mastery for Assembly & Fabrication

April 25, 2024
This guide explores PCB circuit board design, focusing on both Design For Assembly (DFA) and Design For Fabrication (DFab) perspectives.

What is Design Rule Checking in PCBs?

April 25, 2024
Explore the importance of Design Rule Checking (DRC) in manufacturing and how Autodesk Fusion 360 enhances the process.

Unlocking the Power of IoT Integration for Elevated PCB Designs

April 25, 2024
What does it take to add IoT into your product? What advantages does IoT have in PCB related projects? Read to find answers to your IoT design questions.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!