I'm looking to build a simple DC voltage comparison circuit that outputs a logic high or low depending on the input, say when it rises above 2V.
From my admittedly rudimentary understanding of op-amps, if I put my input signal at Vin, a 2V source at Vref, a 5V source at Vcc+, and ground Vcc-, Vout should output between 0 to 5V.
What confused me though is in all the examples I've seen of this setup, Vcc+/- are always equal but opposite (i.e. +5V and -5V). Is it possible to achieve this effect with Vcc- grounded, or am I misunderstanding how this circuit works?
Thank you for your help.
Clarification - So to summarize my overall project, I'm trying to add "Turbo Button" functionality to an old Sega Nomad (the handheld version of the 90's Sega Genesis/Mega Drive). "Turbo Mode" was a feature on some third party controllers; when enabled, you could hold down a trigger button (A/B/C/X/Y/Z) and the system would act as if you were rapidly and repeatedly pressing it (good for shooters where "mashing" the fire button would fire faster than just holding the button down).
Note that I haven't been able to confirm exactly how the original turbo controllers work; info online is scarce, and the three controllers I own (all by different manufacturers) all use chip-on-board circuits, so there's nothing to see inside but a big blob of epoxy.
To quick explain the system's controls, there are a total of 12 buttons (4-way D-Pad, 6 "triggers"(A/B/C/X/Y/Z), START and MODE) which are all simple membrane buttons that short their respective signal line to ground. These signal lines feed into a multiplexer, which has a "select" line that is pulsed by the CPU either once or three times per frame depending on the game. The Genesis originally released with a 3-button controller (A/B/C), but late in its life had an updated controller with 6 buttons (A/B/C/X/Y/Z) which used three "select" pulses. The MODE button was included for the small handful of games that had compatibility issues with the 6-button controller; holding it down at startup would force the controller into 3-button mode. This is important because the MODE button is otherwise unused, and is thus a free signal line for modders.
My original design uses an SPDT switch at each button to individually enable/disable turbo mode; one switch leg goes to ground for normal button functionality, the other leg connects to ground through an analog switch IC, controlled by the multiplexer's select line via a T flip-flop. The select line's pulse should toggle the flip flop, opening/closing the analog switch every other frame, thus "pressing" the button as fast as the system can possibly read it:
I haven't tested this idea yet, but it seems pretty sound. I've ordered a cheap oscilloscope and should have it soon so I can verify the multiplexer's select line (the Nomad uses a proprietary chip for it, so no datasheet is available - all I have to go off of is this pinout).
The problem with this design is the physical SPDT switches: I don't want to cut holes in the system and have a bunch of ugly switches sticking out. My work-around idea is to use analog SPDT switch ICs, and toggle each button's turbo mode by using a combination of the system's existing buttons; i.e. MODE and the respective trigger button (A/B/C/X/Y/Z). I can use a NOR logic gate to detect when the buttons are pressed (both lines will go low), but the problem is once turbo mode is enabled, the trigger button's line will be connected to the clock and the pulsing will immediately shut turbo mode right back off, since the user won't reliably be able to press the button for a short enough period of time (at 60FPs, it'll be a 30Hz 50% duty cycle square wave).
The rough idea I have is to convert the clock signal to a steady logic high/low before it goes to the NOR gate (based on this post with a similar problem), in order to prevent it from immediately toggling turbo mode. A WIP sketch of the solution is below, but it's not right, there would need to be an inverter after the "clock converter" since it's passing logic high when A is pressed... I'm still working on it.
Even if it does work though, it's really not an ideal solution. It adds a lot of extra parts when you consider it needs to be duplicated to all 6 trigger buttons... If I could find an SPDT IC that has a built-in toggle feature though (instead of requiring a continuous signal to stay closed), I could eliminate all the flip-flops and greatly reduce the component count, but I haven't found anything like that so far.