Subject:
|
Re: Millisecond timing
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Fri, 30 Jul 1999 16:26:53 GMT
|
Original-From:
|
Will Bain <willbain@AVOIDSPAMcs.umt.edu>
|
Viewed:
|
1018 times
|
| |
| |
> "Landahl, Bill" wrote:
>
> I recently bought a Handy Board to use in acquiring time measurements varying by
> one millisecond. The Handy Board has a clock speed of 2kHz, therefore it should
> be able to measure down to one half millisecond.
>
> What I have found however is that the smallest time I am measuring is 3 millieseconds.
> Ther is no code running except for the time acquisition code. My question is, Will
> it be possible for me to get the one millisecond time accuracy I want? Should I be
> using system interupts instead of just reading system time? If so, how do I do that?
See the Polaroid sonar code (from the HB web site) for an example of how to measure timing signals on the TIC3 channel. You initialize with:
bit_set( 0x1009, 0x30 ); /* ddrd */
bit_set( 0x1021, 1 ); /* at tctl2, */
bit_clear( 0x1021, 2 ); /* set tic3 for rising edge */
then start timing with:
poke( 0x1023, 1 ); /* clear tic3 flag */
start_time = peekword( 0x100E ); /* capture start time */
then do something else for a while, and finish with:
return peekword( 0x1014 ) - start_time; /* tic3 has time of echo */
I confess I really don't understand it (especially, what's the difference between peekword(0x100E) and peekword(0x1014) ???) but it seems to work.
-- Will
, ,
__@_/ \_@__ |/
| /__, o @_/
)\ ) ( \ (\/\\,
~~~~~~~~~ ' ` ~~~~~~~~~~~ ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wendy Parson, When people are free to do as they please,
Will Bain, they usually imitate each other.
& Tatoosh --Eric Hoffer
|
|
Message is in Reply To:
| | Millisecond timing
|
| I recently bought a Handy Board to use in acquiring time measurements varying by one millisecond. The Handy Board has a clock speed of 2kHz, therefore it should be able to measure down to one half millisecond. What I have found however is that the (...) (25 years ago, 30-Jul-99, to lugnet.robotics.handyboard)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|