home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mksol!strohm
- From: strohm@mksol.dseg.ti.com (john r strohm)
- Subject: Re: Accurate Timing in Visual Basic
- Message-ID: <1992Dec15.155224.18215@mksol.dseg.ti.com>
- Keywords: Visual Basic, Timing
- Organization: Texas Instruments, Inc
- References: <29569@castle.ed.ac.uk>
- Date: Tue, 15 Dec 1992 15:52:24 GMT
- Lines: 23
-
- In article <29569@castle.ed.ac.uk> wbg@festival.ed.ac.uk (W Geake) writes:
- >In order to run an analogue to digital convertor module from a serial
- >port, I want to send a byte from the port every 10 ms. This sets the
- >sampling rate, so the accuracy of the interval is very important. The
- >VB Programmer's Guide mentions BUILT IN POTENTIAL FOR ERROR in timer
- >controls, a great euphemism if ever I heard one. Can I get good precision
- >from VB, or do I need to work in C (please not!) or C++(worse still) or
- >write a VxD (I'd rather sell life insurance)?
-
- Bill, you have a fairly hairy problem on your hands. In order to get that
- rate, you are going to have to grab one of the timers (probably the keyboard
- scan timer) and reprogram it to 100 Hz. Then you are going to have to install
- a custom interrupt handler to pump the serial port. And you STILL have to
- worry about DOS or something else taking over your machine for many milliseconds
- while it does something it thinks is more important.
-
- If I were in your shoes, I would grab a microcontroller or a single-chip
- microcomputer and dedicate it to pumping the ADC. If all you need is a pulse,
- just so the ADC module gets SOMETHING, then something like a Motorola 68HC705K1
- would probably work just fine. If you need a real-live character, then an 8751
- or something along those lines (68HC11, say) would work well. (Note: I am
- extremely fond of the New Micros Inc. F68HC11: it comes with Forth blown into
- the on-board ROM.)
-