This is a crazy question for Logic Experts...
i know this can be done very easy with Arduino / Atmel Studio,
or a real DPDT switch, or FPGA, but i'm looking other ways to Emulate DPDT Switch with Logic,
Long Story Short:
found a very old 1980s or 1990s Rotary Contact Encoder,
same size & pins as Arduino KY-040, same push button,
but is Not standard 2-Bit Quadratic 90°, Nor Gray.
the output is:
CW = A Only,
CCW = B Only.
vs.
90° 2-Bit Quadratic:
CW = A 0°, B 90°
CCW = B 0°, A 90°.
I have Not found a replacement for that strange Encoder,
so i need to make a converter from 2-Bit Quadratic to Dual 1-Bit.
90° Quadratic Rotary Encoder can be emulated very easy using 2x momentary push buttons,
CW = press ButttonA and Hold, then press ButtonB hold & release both.
CCW = press ButttonB and Hold, then press ButtonA hold & release both.
i'm looking the opposite...
to emulate independent Dual Push buttons with 90° Quadratic Rotary Encoder.
This circuit can be viewed in different ways...
like DPDT switch.
like a USB Mouse Wheel Incremental Rotational Encoder, But Not optical,
like independent push buttons.
like an Electric Ratchet Circuit.
or a Quadrature Decoder HCTL-2020
or like an Inhibit circuit.
When A is 0° High, Inhibits B 90°, Sets B Low.
When B is 0° High. Inhibits A 90°, Sets A Low.
when viewed as DPDT switch:
Switch Up,
Center Left "Pin 2" connected to Pin 1 "Left Up", connected to A Out.
Center Right "Pin 5" connected to Pin 6 "Right Up" connected to GND.
Switch Down:
Center Left "Pin 2" connected to Pin 3 "Left Down", connected to GND.
Center Right "Pin 5" connected to Pin 6 "Right Down" connected to B Out.
but the idea of using Logic is to make the DPDT Switch Automatic.
when detects:
A 0° = Up,
B 0° = Down.
in Arduino can be done very easy,
creating a Encoder Script to detect 2-Bit Encoder State,
00 = 0
10 = CW
01 = CCW
11 = Error / Ignore.
CW = Pulse Out1,
CCW = Pulse to Ou2.
Pulse can be 1ms or 0.1ms.
problem with Arduino is that
Uno is a Big PCB,
i need a very small sollution,
Atmel has very small 8-Bit MCU, ATTiny88
but Arduino code must be converted to Atmel/MPLab Studio 7.c
Atmel requires setting manual switches,
needs another programmer, like Atmel STK600 & Routing cards for ATTiny pinout.
ATTiny does Not have USB to serial interface IC, needs to be programmed by other methods,
because its a MCU, may be sucepticle to bad power, or interferences, or may create interferences to the circuit i want to replace / repair.
needs PCB design in Autodesk Eagle or Target3001! or KiCAD "i try to avoid KiCAD because does Not have CNC G-Code for DIY home made prototype"
i try to avoid China PCB Factories.
CNC needs special software, MATCH4 / 3 is a nightmare to install, license is Node locked, and has limited activations,
found another CNC software in Europe
i own Match4+Parallel port plugin but i try to avoid it, requires a dedicated computer, that cannot be repaired, upgraded or updated,
Node Locked with Limited Activations per Year / Lifetime, is an Absurd Licensing Method.
is unknown if works in ReactOS, Needs Discontinued WindowsXP or 7 32-Bit Only.... A Nightmare.-
Atmel / MPLab Studio 7 does Not work in Linux or Mac only Windows.
Moving Windows to another HHD / SSD, is Not as easy as cloning Linux or OSX,
Windows does Not boot from USB3.0, Nor Thunderbolt2/3,
etc...
i try to avoid windows.
and Chinese PCB factories.
i would like to try Logic before doing the Atmel ATTiny.
too much problems to replace a Potentiometer / Encoder.