[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] generate squares



On Sat, 11 Mar 2000, dding wrote:

>     I want to generate squares from parallel in the highest frequency and
> stable needed. pthread_create() and pthread_make_periodic_np() only give me
> the stable square wave about 30k HZ . I need 120k HZ or more.

I am afraid this is above the limit of PC hardware.

120 kHz means period of 8 us. You need 2.5 us just to switch the paralel port
2 times. Interrupt latencies on a PC are 3-10 or even sometimes more
microseconds. 

The only way you can get it is a busy-loop. No other tasks allowed.
Much better way to generate a square wave of this frequency is to use
dedicated hardware. In any case you will _not_ get a jitter less than 1
microsecond on a paralel port.

--
Tomek