home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / msdos / programm / 8038 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.8 KB

  1. Path: sparky!uunet!utcsri!torn!utzoo!dciem!jyan
  2. From: jyan@dciem.dciem.dnd.ca (Joseph Yan)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Timing Problem
  5. Message-ID: <6111@dciem.dciem.dnd.ca>
  6. Date: 23 Jul 92 13:33:24 GMT
  7. Organization: Defence and Civil Institute of Environmental Medicine
  8. Lines: 29
  9.  
  10. Hi folks!  I'd like to solicit any help I can about this timing problem:
  11.  
  12. I'm working on some data acquisition from a "black box" that outputs
  13. reports of a device's position and orientation.  Unfortunately, this
  14. box will output a report at a frequency between 20 reports/sec to 50
  15. reports/sec and the time interval between reports varies depending on
  16. the time taken to process info within the "black box" and whether or not
  17. there are any invalid reports in between.  My problem is that I want to
  18. be able to analyze this data for velocities and accelerations so if the
  19. time interval between reports varies, I'd like to store the time of the
  20. report along with the report itself.  The time should be accurate to at
  21. least 10 ms but the clock() function in C and the other time functions
  22. I've looked at are only accurate to 55 ms (because it's updated 18.2
  23. ticks/sec).  I tried some assembler code using function call 2Ch which
  24. is supposed to report the time to hundredths of a second but I found
  25. that it also was only updated at 18.2 ticks/sec.  In one technical
  26. reference I flipped through, I read that the MC146818A Real Time Clock
  27. generates a timer tick 1024 times/sec and this would be great but I
  28. haven't figured out how to access it.
  29.  
  30. I'm using a 386 and accessing the "black box" through the RS-232 port
  31. but that's probably not important.
  32.  
  33. Is there any kind soul out there, who can help this poor soul by telling
  34. me how, or if it's even possible, to access a timer which is accurate to
  35. 10 ms?  Please reply directly to jyan@dretor.dciem.dnd.ca if you have
  36. the answer.
  37.  
  38. Joe
  39.