Re: High frequency output on parallel port, how?
From: Robby Tanner (rtanner_at_lightsource.ca)
Date: 09/21/04
- Next message: Ray Trent: "Re: is it possible (fake file)"
- Previous message: Robby Tanner: "Re: High frequency output on parallel port, how?"
- In reply to: Bert: "High frequency output on parallel port, how?"
- Next in thread: Neptune: "Re: High frequency output on parallel port, how?"
- Reply: Neptune: "Re: High frequency output on parallel port, how?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Sep 2004 15:50:25 -0600
You could also try the High Resolution Performance Counter.
Calling QueryPeformanceFrequency() on my PC gives 3579545 counts/second or
3.6 MHz (or 279 nS/tick). Knowing that, you can poll the performance
counter (QueryPerformanceCount()) adding up the time intervals until you get
the frequency you want. For example, to get 3.6 kHz poll until you have a
thousand ticks and then strobe your output. For a 50% duty cycle, you'd
need a bit more code and I'm not sure how much jitter is involved, but if
you want to do it all in user space, you could do some testing with the
perfomance counters.
Cheers,
Rob
"Bert" <bert@nospam.home.nl> wrote in message
news:ciq37s$qh7$1@reader08.wxs.nl...
> Hi,
>
> I want to control stepper motors from XP, this requires me to toggle the
> parallel port datalines with a frequency ofseveral KHz.
> I have the givio driver which gives me IO privilege so that I
> can write and read to the port in usermode.
> Now I have the problem that the fastest timers in user mode is the
> multimedia timer which works with 1 millisecond at most.
> These guys http://www.artofcnc.ca claim that they can get 35 KHz output on
> the parallel port of a 1 GHz machine running XP,
> I know that they use a device driver, that's why I ask this question here.
> How do I accomplish a timer that works with much higher frequencies, does
> anybody of you kernel programmers know?
>
> Bert
>
>
- Next message: Ray Trent: "Re: is it possible (fake file)"
- Previous message: Robby Tanner: "Re: High frequency output on parallel port, how?"
- In reply to: Bert: "High frequency output on parallel port, how?"
- Next in thread: Neptune: "Re: High frequency output on parallel port, how?"
- Reply: Neptune: "Re: High frequency output on parallel port, how?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|