From owner-freebsd-hackers Sun Sep 30 8:17: 5 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.shell-server.com (24-109-11-245.ivideon.com [24.109.11.245]) by hub.freebsd.org (Postfix) with SMTP id 1C01B37B40D for ; Sun, 30 Sep 2001 08:16:51 -0700 (PDT) Received: (qmail 12894 invoked from network); 30 Sep 2001 15:16:50 -0000 Received: from betsy.shell-server.com (HELO there) (192.168.3.2) by erin-rl0.shell-server.com with SMTP; 30 Sep 2001 15:16:50 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Bart Kus Message-Id: <200109301010.07784@EO> To: hackers@freebsd.org Subject: precise timing Date: Sun, 30 Sep 2001 10:18:01 -0500 X-Mailer: KMail [version 1.3] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On a totally unrelated subject to my sio.c message, I have a second problem. I've built a computer-controlled drill, that is controlled via the parallel port. This drill uses stepper motors, at 1/2 step. My driver software implements a maximum-acceleration control algorithm that ensures that at any point in time, any axis will not experience more than X m/s/s of acceleration. This keeps the drill from self-destructing. :) Unfortunately, it means I need access to a very precise timing source to issue the step instructions to the motor control board. Right now, I use for() as a timing loop. I calibrate it on program start and can then get very precise timing. There are, of course, the intermittent interruptions of the multitasker. So this solution is not ideal by any means. In fact, the for() loop approach is really meant for the DOS port of this software. I'm wondering if there is any way I can access a more precise interrupt-driven (or blocking) timing source. I know I can do a select() with supposedly microsecond accuracy, but I doubt that it is in fact that accurate in practice (doesn't the kernel only use a 100Hz clock or something?). Is there any way to get at the system timers on the motherboard? Those can provide precise timing, no? --Bart To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message