Date: Sat, 4 Oct 1997 23:25:44 -0700 (PDT) From: mdean <mdean@best.com> To: freebsd-hackers@freebsd.org Subject: A world of unexplored pain. Message-ID: <Pine.SGI.3.95.971004230439.6896A-100000@shellx.best.com>
next in thread | raw e-mail | index | archive | help
Please stop me if I am about to waste my time doing something that just isn't possible. I have received a lot of conflicting arguments on wheter or not the following is possible (more importantly will it function as designed). What I need is one or more 0-500Hz Square Waves generated at the output pins of and 8255 PPi. These are to be used to run the inputs to a single axis stepper motor controller. I have the device drivers for dos, however my application is such that it would be truly a waste to not have a networked application (also considering that the controlling app run under X). The do device driver function quite nicely, however when called they consume 100% cpu time and **CANNOT** have the commands cancelled once called. One reason to use a comuputer to do this instead of a custom controller is co$t the other is complexity. To properly control the motors the pulse train must be scaled from 0 to 500Hz and back down as it slows. This is not a standard feature on the 68hc11 even though it has nearly everything but the kitchen sink built in. With a freebsd machine I am likely to be able to accomplish this and also set it up as a system where the target position can be changed in realtime, thus making it possible to cancel a command. I just cannot do this with the embedded equipment I have available (mc68hc11) because a) rti on the 68hc11 don't run faster than 500hz (you need 1000hz for a 500hz square wave) and b) if the routine was dedicated then the rs232/485 interrupt would possibly cause a lot of jitter taking the commands while scaling the output. I think that this can be done from what I've seen you can acquire_timer0() from clock.c up to 20000hz to your interrupt routine. This should make possible driving equipment of this type or any small scale polling stuff like AtoD boards without there own interrupts (there are quite a few of these available). I guess Ideally I should combine AtoD drivers and digital output drivers into one so that they may share the same interrupt routine, the real question for me is: If I use acquire_timer0(1000, myintr) what kind of jitter should I expect in delivery of those interrupts, i.e how far off center will myintr() get called from the every 1/1000 of a second mark?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SGI.3.95.971004230439.6896A-100000>