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