I'm in the process of designing a wireless controller receiver for the NES/SNES game consoles. My wireless receiver consists of a bluetooth module and an AVR microcontroller, with the microcontroller connected to the controller's control lines. It's designed to be installed inside the console itself, but I don't want to break support for normal controllers, so I need some way of detecting when a controller is plugged in.
The controllers themselves aren't designed with this in mind, so I've been looking into a couple of options. The NES/SNES controllers are basically nothing more than a parallel-to-serial shift register (the NES controller just uses an off-the-shelf CD4021, the SNES has a custom chip that is basically just a 12-bit version of the same thing) with pull-up resistors and membrane switches to ground on each of the parallel inputs, and the latch, clock, and data (bit 8) signals connected to the cable between the console and the controller.
Monitoring the data line doesn't do any good, because there is no way to discern between having a controller plugged in with no buttons pressed vs. no controller plugged in, so the controller isn't detected until after a button has been pressed, and there's no way to detect that the controller has been disconnected, because it appears just the same as if the controller was connected but idle.
My next option is a high-side current sense circuit, using the controller as the load. With the controller disconnected, no current flows through the sense resistor, so no voltage is dropped across it. When the controller is connected, current flows, voltage drops, current sense amp outputs a voltage. This is working fine with one exception. When I first apply voltage to the circuit, or when I connect the controller, there's a momentary voltage spike on the monitor's output line that hits roughly double the supply voltage, so that's no good. I'm not even sure how exactly that's possible, since the spike goes above the supply rail, but it's pretty clear on the multimeter.
Analog really isn't my thing so I have a feeling I'm doing something wrong. I've attached my current schematic, can anybody suggest a good way of suppressing this voltage spike? I'm not sure if a zener diode would be fast enough to handle it, and adding an RC low-pass filter onto the output doesn't help either, and just ends up lowering the output voltage. I need something, I'm pretty sure 10V will blow the ADC pin on the microcontroller. Any thoughts?
Looking at the schematic, I realize I forgot to add decoupling caps on the INA282 supply line as per the datasheet. I have them in the circuit, but I still get the spike.