I am on to mapping with Walter now. He has stripes on his wheels and a typical IR led/sensor set-up for each wheel. There are actually 2 sets of encoders --One set R/L for the navigation and a second that are attached to a dedicated 28x2 whose sole purpose is to watch the wheels go by (he has a couple eeproms attached as well).
Now, I know a typical encoder either rotary or optical works off of the 1/2-step-off idea so "one 1/2" of each encoder will be triggered first thus showing the direction of travel. Considering that picaxes are slow as dirt and that there would be a total of 4 things to watch (which one changed first on which of two sides?) I simply don't think that the picaxe is going to keep up. Not to mention adding to the loop time is a big chunk devoted to writing the "counts" to the eeprom. (I am quite surprised at how slowly you need to write to these eeprom chips... I need at least 5us of pause between writes to keep writing clean data)
As I entered this problem I assumed hey, this is no problem, I will simply tell the encoder picaxe which way we intend to go, and it would count which ever wheel is needed and stop counting and write when we tell it the direction has changed. (BTW --an assumption is made here that the wheels are going the same speed and during fwd and spins only one encoder is watched). This method has been a massive failure of serial sends, interrupt loops (that are constantly being interrupted) and a lot of too-fast writes and spoiled data coming out of the eeprom when I read back the data. --The writing to the eeprom is done inside of the interrupt loop and with serial input being done in the background, a new byte can come in and sit right on top of the byte I am trying to write and spoil the whole lot up. So here we are...
Simple problem: I gotta chip that does nothing but watch wheels and it simply needs to know when the direction of the wheels has changed. Right now, I am soldering a simple board of transistors that I will attach directly to 12v power going to the motors. The transistors are there of course to keep the 5v side and the 12v side from fighting and to keep the magic smoke in my little robot brains. --I would attach directly to the PWM signal coming out of the navigation chip itself, but at low PWM's I don't know if it will be enough juice to click a transistor or input pin high. I don't wanna hear about adc's either, this has to be digital for a quick, yes-or-no read of the pins. This way, the pic simply has to check 4 pins or 1/2 a byte to see which way the motors are going and if that direction has changed, start count/stop count/write direction to eeprom and/or write count to eeprom. This is by no way a suggestion of the way it is supposed to be done, but I am tired and have been working on this for quite some time and when in doubt, I usally find a hardware solution before a code-based one.
I guess that's it. As I said, this is an open discussion, gimme what you got.
P.s. --the data going to the eeprom is in 2-byte packages: the first byte is a letter noting the wheel and/or direction and the second is the number of counts.
I.e.
R,127 --this is right spin 127 counts
r,47 --this is right slide, 47 counts
f,35 --forward 35
L, 34 --left spin 34
l,45 --left slide 45
E,0 --end of mapping
etc. etc. etc.