tl:dr I need some way to flip high to low and low to high on the output of a 74ls393 running as a frequency divider. The circuit I'm trying to build needs to have two select lines pulsed in a specific order and currently I'm getting the exact reverse of pulse order that I need. Either I need an extra component to do this or perhaps there is a a part that can do this naively that could replace the 74ls393 entirely?
Hello, this is my first post here so I wanted to start off by saying thanks for providing such a fine resource to budding electronic hobbyists such as myself. Now I've finally gone ahead and joined this forum for probably the same reason that most do, which is to put it simply, I'm stumped.
So here's a quick overview of what I'm trying to do. I am trying to build a variation of this circuit here:
This circuit functions as a demuxer for Sega Saturn control pads and gives discrete outputs from button presses on the controller. Now as is this circuit does actually work with official Sega Saturn control pads which are simply made of a pair of 74hc153A dual 4 in 1 out multiplexers. The issue that I'm having has to do with using a non standard controller with this same circuit, in this case the microcontroller based MC Cthulhu arcade board. This board is meant for connecting arcade joysticks and buttons to multiple game consoles including the Sega Saturn. It simply emulates the protocol of whatever game console it is connected to at the time. The problem that I am having is that when MC Cthulhu is connected my button mapping is reversed for two of the four possible states of the select lines. Here is a table of the bit assignments for the Saturn controller:
In my case the outputs are flipped for "S0 off S1 off", and "S0 off S1 on". The other two combinations work fine. After probing both a real Sega Saturn and my circuit I uncovered why those two states are being flipped. It's because the MC Cthulhu takes a shortcut in it's programming. Now I'm not 100% sure how the MC Cthulhu works because it's designer went AWOL a couple of years ago and nobody else seems to have any insight into how it works under the hood, but based off it's behavior in my testing it seems that the Cthulhu doesn't actually read each pulse from each select line and send the correct output for that pulse. Instead since it was developed only to work with the Sega Saturn which has a known specific pulse order I think it simply has a predetermined order of outputs that it sends every full select pulse cycle regardless of what order it is receiving the select pulses. Here is a look at how a real Saturn console pulses these select lines. S0 is channel 1 and S1 is channel 2:
And here is how the circuit above pulses the select lines. Same as before S0 is channel 1 and S1 is channel 2:
The duty cycle is really weird on the saturn but I don't think that's a concern. The real concern is that these two circuits pulse in exactly the opposite order. I've made a couple of tables to make it easier to visualize.
Original Sega Saturn Hardware:
Saturn pad Demuxer
As you can see states 2 and 4 are flipped. So all of this to say, what I need is to reverse the output waveforms high to low and low to high so they pulse the select lines in the correct order. Is there an equivalent binary counter that will give me the reverse of this output instead of the 74ls393, or is there additional circuitry that would give me the desired effect? Any advice is greatly appreciated.