Subject:
|
Re: encoder function
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Sat, 7 Feb 1998 14:05:13 GMT
|
Original-From:
|
Fred G. Martin <fredm@/StopSpam/media.mit.edu>
|
Viewed:
|
2009 times
|
| |
| |
Tom, it seems that your routines measure frequency but Yoni wanted to
count transitions.
Yoni, the approach is similar to what Tom has done in that you must
use the timer input channels to get high frequencies. In the TCTL2
register, set the input lines to interrupt on either rising or falling
edges. Create an interrupt routine that increments a memory variable
on each interrupt, and then resets the interrupt flag for the next
time.
Each transition on the timer input pin with then cause the memory
variable to be incremented.
Fred
|
|
Message is in Reply To:
| | Re: encoder function
|
| Hi all I have written some routines to measure frequencies from 30Hz to 30kHz. I'm posting this with an attachement because several people have ask me already for these routines. To Fred: You can add these routines to the ftp server or anywhere on (...) (27 years ago, 6-Feb-98, to lugnet.robotics.handyboard)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|