On Sat, 1 Apr 2000, Bart Vandewoestyne wrote:
To be absolutely safe I would disable interrupts here.
> --> I set one bit of the parallel port, say A, high (for visualisation
> on an oscilloscope)
>
> --> then I need to count 10000 pulses, i do it with the following
> C-routine:
>
> void count(int time)
> {
> int value = 0;
> int clock;
>
> while (value < time) {
> do
> {
> clock = inb(BASEPORT+1) & 0x80;
> }
> while (clock == 0);
>
> do
> {
> clock = inb(BASEPORT+1) & 0x80;
> }
> while (clock == 0x80);
>
> waarde++;
Probably value ++ ???
> }
> }
>
> --> Then I set the bit A back to zero.
>
Here, enable back interrupts. Unfortunately 10000/109000 ~ 0.1 s - very long
time for keeping interrupts disabled! There should be some way of generating
interrupts on every pulse, fast machine could even do this 109 kHz if you
only increment counter in real time ISR. But in general multitasking OS and
PC is not made for counting pulses at 109 kHz. May be you could just divide
them by 16 using 7493 chip and read the last 4 bits through paralel port.
> So, that means that every time i call the function count(10000) I should
> always see the same HIGH-time for bit A, and that's not what happening!
> The HIGH-time for A isn't a constant. I have also written a similar
How big are the differences? How frequently it jumps?
Did you program it as kernel module or user space program?
--
Tomek
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/