problem with d flip-flop rotary decoder

Thread Starter

razie1

Joined Jan 22, 2013
8
im using breadboard at the moment but the circuit i built is same as the one you posted
I also have simulated the circuit on proteus and have same results
 

crutschow

Joined Mar 14, 2008
34,409
The circuit logic would seem to be ok. But I have also seem some odd results at times under certain simulation conditions. There appears to be some odd race condition that sometimes occurs when the D input and the /Reset go high at the same time. Perhaps a small delay is needed between the time the D input goes high and the /Reset goes high.
 

WBahn

Joined Mar 31, 2012
30,045
The circuit logic would seem to be ok. But I have also seem some odd results at times under certain simulation conditions. There appears to be some odd race condition that sometimes occurs when the D input and the /Reset go high at the same time. Perhaps a small delay is needed between the time the D input goes high and the /Reset goes high.
This should be a purely simulation artifact since the D input is ignored unless the clock transitions. I checked the datasheet for the 74HC7474 and it doesn't have any timing specification at all for the /R relative to the D inputs, so they are claiming that no race conditions (at least not critical races) exist between those two signals.

I'm not convinced that this circuit doesn't have problems, but I just haven't had the time to sit down and play with it.
 
I know this is an old thread, please forgive if I'm intruding with this, my first post here. I'm quite excited about researching quadrature encoders as it's probably the first time I'm actually applying my BSEE since graduation in 1998. :p

I found this question as I'm researching my situation of an Arduino reading the quadrature output from a linear glass slide DRO encoder. Specifically, I'm finding if I slide the scale too quickly, the Arduino skips some pulses, even though some people are claiming an interrupt only takes ~5 usec. On my scope, I was able to ascertain the shortest positive pulsewidth to be 20 usec, so one might think I'd be ok. So I'm looking into some logic to remove any "thinking" from my Arduino and I can make its interrupt as simple as incrementing or decrementing a counter.

IMHO, the first diagram will have problems because only in one direction will both inputs to the top AND gate be positive, therefore, in only one direction will that AND gate enable the AND'ed outputs. This feels like the reason the LEDs only work well in one direction.

My other research has tried to tell me that you could use Q for one LED and Qnot for the other LED. This is what I'm going to attempt to implement tomorrow. I have 3 ICs I can try... 2 are 7474s (SN7474 and SN74LS74A : Dual D-Type Positive-Edge-Triggered Flip-Flops With Preset And Clear) and a DM/SN74121 : Monostable multivibrator with Schmitt-trigger inputs.

I'm hoping the D F/F with Q and Qnot can trigger increment and decrement interrupts on my 16MHz Arduino.

:) Chris
 
Top