Backround Counter
Other than the PWM/Pal does anyone of a single IC 8-Bit Counter with a serial output, preferably I2C or clocked synchronous. I want to use them as a Backround Counter for my robot's wheel encoders. I built a hardware version using counters and shift registers that works great with my BS2P, but a single chip solution would be better.
Comments
Generally chips which manage encoder counts have a good deal more than just 8 bits. Here are a number of IC's used with encoders to maintain the counts and process the quadrature encoding from the wheel encoders:
http://www.usdigital.com/products/ics.shtml
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
So these encoders are just used as odometers?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Well, what I've been doing is converting the counter output to RPM's (count per sec * 60 sec / 32 segments) comparing that to the speed set point and adjusting the left and right speed input to the motor drivers to maintain equal speed in the forward and reverse directions. I also accumulate the running count total and save it in a RamPackB 32K to be converted to distance data. My jury rigged hardware counters are ok but I still get some jitter even after some digital filtering, however I think some of this is mechanical which I need to attend to.
Okay, now I see what you're doing. You're using the wheel encoders as wheel speed tachometers, rather than using a motor tachometer and dividing down by the gearing. Unfortunately by using the system you're using, you ended up "cheating" yourself. Had you used quadrature encoders at the wheels, you could have had both speed AND direction! With only the single channel you have, you've got wheel speed, and that's it.
Perhaps obviously, or perhaps not, the chips I indicated earlier are used on quadature encoder systems for maintaining counts and direction. All you need for this use, is any 8-bit (octal) up-down counter with reset. I'm sure one of the hardware gurus will know the number of same, right off the top of his/her head.
8 bits will give you a count of 0-255 revs which is more than enough for your purposes. Chances are better than even that you won't find one with a serial output, so just connect the 8-bit, binary output to a parallel-in ==>> serial-out shift register, and use SHIFTIN to grab the counts when you need them. After grabbing the count, hit the RESET line, and you're zeroed out, and ready to go again.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
The hardware counters that I built are exactly what you recommended. I have two 74HC4520 synchronous counters connected to two 74HC165 shift registers and it works fine but I was interested in reducing my chip count. In terms of quadrature encoders, I've always wondered : If I command the robot to move forward why do I need chan B of a quad encoder to tell me the direction that I already know! I'm kind of new at this so please teach me; I joined this forum to learn.
Thanx,
Danny