Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!wuarchive!psuvax1!rutgers!mit-eddie!snorkelwacker!spdcc!xylogics!world!jstone From: jstone@world.std.com (Jeffrey R Stone) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: Using a PC to monitor an external signal (How?) Message-ID: <1990Jul6.015701.22051@world.std.com> Date: 6 Jul 90 01:57:01 GMT References: <1990Jul4.215014.29212@mintaka.lcs.mit.edu> Organization: The World @ Software Tool & Die Lines: 22 streeter@theory.lcs.mit.edu (Kenneth B. Streeter) writes: >I would like to use an ibm pc to monitor an external signal. The >signal in question is from a single digital wire. The signal on the >wire is essentially a square wave, from 0V to 5V, with an irregular >period. The input signal frequency would never be above about 150 Hz. >Essentially, what I want to do is simply count cycles. (Rising edges >of the wave, actually.) It would be nice to be able to count LOTS of >these pulses (for about 8 hours). The serial port handshake signals make OK digital I/O ports (2 bits each direction, per port) if you can arrange your signals to fit meet the voltage specs (0 to 12v, I think). It sounds like you'd need only one of the inputs. Monitoring it wouldn't take much CPU power at < 150Hz. A simple polling loop could maintain a pulse count, and by hooking the timer interrupt, you could do whatever count vs. time stuff you need to do (just keep it short). A 32 bit int can count to over 2 billion before overflowing, even with a bit reserved for the sign. That's 20 million seconds at 100Hz, or about 8 months. Should meet your requirements! :-) -jeff-