I have wired a 600 p/r incremental encoder to an Arduino Uno.
My question is this:
Given that the Arduino has a clock speed of 16Mhz and I really do not want to miss a single pulse I am creating a CMOS hard copy of the logic. I have:
Inc Encoder -> firing edge trigger (by propogation delay) through xor and nxor cmos (acting as clock) -> 16bit binary up/down counter -> d flop register
The inc encoder also has a logic block which denotes which direction it is turning (it sets the up/down pin of the binary counter.
My problem is this - how would you deal with the Arduino reading the current count. I do not like directly reading the counter as it can change during read i.e. if it is 9, the arduino reads LSB and during time taken to read next the counter increment to 10 then I could end up with a reading of 19. I thought about a buffer but if I use the edge trigger logic then it appears that by the time the counter has done its logic the flip flop register will have read the revious value.
I am looking at async Preset with data hold but this type of d-flop / other flip-flop are rare(ish)
Any other scheme I should think about?