Thread View: alt.flame.pascal
1 messages
1 total messages
Started by Manuel Fischer
Wed, 12 Jan 2000 00:00
How to count time of signals in real Time with PC-Timer ?
Author: Manuel Fischer
Date: Wed, 12 Jan 2000 00:00
Date: Wed, 12 Jan 2000 00:00
59 lines
2912 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads