
02-01-2005, 11:44
|
|
Registered User
None #0116
Team Role: Engineer
|
|
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
|
|
|
Re: Optical Mouse Navigation
Quote:
|
Originally Posted by phrontist
Hmmm...
I don't think bit banging is nessicary at all. In fact, I don't plan to use interrupts at all. If you look at David Flowerday's post above, he links to the incredibly useful aligent site which has information on all of their chips. Many of the chips have quaderature output, which is really really easy to interface to! But the following issues came up in a discussion between Max and I:
- The mouse would generate interrupts way to fast when the robot was at top speed, even with optics and such
- You need three optical axis's, which means six pins to take quaderature input. Some of the digital inputs on the RC and grouped together, so while possibly doable, it becomes harder.
The solution is to use an accumulator chip, which will take in quaderature input and count "rotations" of the pattern, outputting it in as 8 binary outputs, which can in turn be read by the RC without issue. But no! I hear you cry... you need 8 digital inputs per axis! Well this is where the clever bit come in, once again courtesy of Max. The output of these chips can be turned on and off (and their counts can be reset), through one of the digital outs on the RC. So you connect all three accumulators to the same 8 pins, and than you poll them every so often (as long as its fast enough that the accumulators don't overflow). So you just turn each chip's output on in turn and read the values in!
Pretty cool, huh?
|
Another option is to use a counter with synchronous serial output. You can tie the data and clock lines from all of the accumulators to two RC pins, then have one dedicated RC pin for the Chip Select on each accumulator. The code to shift in the bits would be easy to implement but I think Kevin Watson has already written it.
|