🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.flame.pascal
Article #5

How to count time of signals in real Time with PC-Timer ?

#5
From: Manuel Fischer
Date: Wed, 12 Jan 2000 00:00
59 lines
2912 bytes
Hello together...

I'm writing a Turbo Pascal 6.0 program that
calculates the temperature of a digital temp.sensor that
works with the relation of Hi and Low CMOS signals.
(Every signal change makes an interrupt and starts the
Interrupt Sub Routine procedure...)
The ISR look like this:

Procedure IntHandler; Interrupt;
...
IF  HI THEN                     { If HI Bit --> starts counter for HI
signal }
         BEGIN
           if LOWRq then T2:=z;T2Rq:=false;
           z:=0; T1Rq:=true;
         END

       ELSE
         BEGIN
          if T1Rq then T1:=z;T1Rq:=false;
          z:=0;  T2Rq:=true;
         END;
...

(... means that some code is cut out
T1  is the time of HI Signal
z   is the timer (should be...)
TRq is like a request for counting )

But to calculate the temp. if have to know the frequency,
during of a Hi and a LOW Signal.
For that job i need an exact reference counter form the PC-
Timer to count real time, for example every ms or us over
an Interrupt Sub Routine.


My current counter is very easy but even without any real frequency:

    inc (z);
    if z > 100000 then z:=1;


This "false" counter isn't in a procedure and in an ISR either,
so if will be interrupts every hi or low measure signal.
(That can't be a solution... If has to be in a ISR that will
be started ever ms.
Bur how to realize it without to change the exiting pc-
timer ISR for the system time ? Are the multiple interrupts
for the pc-timer ?)


If anybody is able to help me, please send me a mail to:
manfischer@swissonline.ch

Thanks...

Manuel Fischer
Switzerland
Technical Details
Message-ID: <387CD946.7C08132B@swissonline.ch>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 110467,13e283332aa96bc0,start
X-Google-Attributes: gid110467,public
X-Google-Thread: fd1d1,13e283332aa96bc0,start
X-Google-Attributes: gidfd1d1,public
X-Google-Thread: 10eb32,13e283332aa96bc0,start
X-Google-Attributes: gid10eb32,public
X-Google-Thread: 1043cf,13e283332aa96bc0,start
X-Google-Attributes: gid1043cf,public
X-Google-Thread: 10c950,13e283332aa96bc0,start
X-Google-Attributes: gid10c950,public
X-Google-Thread: 108ebd,13e283332aa96bc0,start
X-Google-Attributes: gid108ebd,public
From: Manuel Fischer <manfischer@swissonline.ch>
Subject: How to count time of signals in real Time with PC-Timer ?
Date: 2000/01/12
Message-ID: <387CD946.7C08132B@swissonline.ch>
X-Deja-AN: 571800265
Content-Transfer-Encoding: 7bit
X-Accept-Language: de,en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@swissonline.ch
X-Trace: news.swissonline.ch 947706339 28257 195.24.92.137 (12 Jan 2000 19:45:39 GMT)
Organization: Swiss Online (Cablecom Media), Zurich, Switzerland
Mime-Version: 1.0
NNTP-Posting-Date: 12 Jan 2000 19:45:39 GMT
Newsgroups: alt.flame.pascal,borland.public.delphi.objectpascal,borland.public.turbopascal,comp.lang.pascal.ansi-iso,de.comp.lang.pascal,fido.ger.pascal