Date: Sun, 05 Oct 1997 16:21:21 -0500 From: dkelly@hiwaay.net To: mdean <mdean@best.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: A world of unexplored pain. Message-ID: <199710052121.QAA28930@nospam.hiwaay.net> In-Reply-To: Message from mdean <mdean@best.com> of "Sat, 04 Oct 1997 23:25:44 PDT." <Pine.SGI.3.95.971004230439.6896A-100000@shellx.best.com>
next in thread | previous in thread | raw e-mail | index | archive | help
mdean writes: > [snip] > 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. Wait right there. The RTI is the wrong place in the HC11 to be doing the kind of thing you are discussing. Look at the input-capture/output-compare functions and their timers. (Maybe I mean output-capture/inpute-compare?). The pink HC11 book discusses generation of waveforms up to 1MHz using self-retriggered modes. You can do the same for your 500 Hz signal plus generate an IRQ on transition and service at your leisure (you have half of your clock cycle to get there). Jitter will be no better or worse than your CPU clock crystal. I used an HC11 that way to generate X-10 signals. Had an external 60HZ IRQ, then used HC11 timers and IRQ's to fire off the 200 uS bit, then again 1/6th cycle later, and again at 2/6ths, one for each of 3 possible phases. X-10 data bits are shifted out immediately following AC zero crossings. When my poor little 2 MHz HC11 got busy it was cranking thru nearly 5k IRQ's/sec. Cheated a bit as 4k/sec were external unmaskable IRQ's, but still the X-10 code timings were perfect. Even worked on 50 HZ (must have been single phase). My employer put up a web page with this product: http://www.tbe.com/products/imperium/imperium.html. best.com, the UPS people? I don't have to tell *you* about AC power. :-) I picked up a FerrUPS 700 at a local hamfest for $125 and its been one of the nicest things I've done for myself. Its a good footwarmer too. Should have bought a couple more. -- David Kelly N4HHE, dkelly@hiwaay.net ===================================================================== The human mind ordinarily operates at only ten percent of its capacity -- the rest is overhead for the operating system.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710052121.QAA28930>