home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / misc / 4035 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.9 KB  |  35 lines

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