From: "Edmund Horner" Newsgroups: comp.os.msdos.djgpp References: <969255238 DOT 8548 DOT 0 DOT pluto DOT d4ee3b86 AT news DOT demon DOT nl> Subject: Re: Help me please!!! Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Organization: Paradise Net Message-ID: <969275870.406106@shelley.paradise.net.nz> Cache-Post-Path: shelley.paradise.net.nz!unknown AT 203-96-154-209 DOT tnt7 DOT paradise DOT net DOT nz X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: Mon, 18 Sep 2000 23:20:17 +1200 NNTP-Posting-Host: 203.96.152.26 X-Complaints-To: newsadmin AT xtra DOT co DOT nz X-Trace: news.xtra.co.nz 969275871 203.96.152.26 (Mon, 18 Sep 2000 23:17:51 NZST) NNTP-Posting-Date: Mon, 18 Sep 2000 23:17:51 NZST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com My advice is that you should have an interrupt called every now and then, that does this (this is pseudocode, BTW): int pulses = 0; int oldpin = 0; interrupt_proc() { read_port (pin); if (pin != oldpin) { ++pulses; oldpin = pin; } } main() { install (interrupt_proc, 100); // call 100 times a second. } "NoDuck!!!!" wrote in message news:969255238 DOT 8548 DOT 0 DOT pluto DOT d4ee3b86 AT news DOT demon DOT nl... > I'm trying to count pulses on the dtr, dsr, tsr of the serial port. I need > count the pulses on 2 different channels, It's for a two rotation-counters. > Because I also need to know the rounds per minute, this program should be > interrupt driven.. > > Is this possible? How should I programm this? > If this is not possible, do you have any suggestions? > > thanks & regards, > > Marcel > > > >