I'm making a sample-and-hold circuit for a 3 bit Flash/Parallel ADC and to allow the conversion to have enough time to happen I want to maintain the input voltage steady for the duration the conversion will take. I intend on sampling an audio signal from a phone or mp3 player.
I'm using the LM358N opamp for the buffers and an IRL520 NMOSFET to switch. The opamps are on dual 9V, -9V supply
To switch the MOSFET, I'm using 0 and 9V signals at 1kHz and the input signal to the buffer is a 6V peak to peak sine wave at 500Hz.
Ideally, the output should be a staircase looking waveform but with my holding capacitor at 1uF the signal is distorted. This is the scope output at 1uF. I've tried quite a few different values for the capacitor to little success.
I initially thought it was due to the switch resistance forming a low pass filter with the capacitor but it Rds is pretty low (0.18 ohms).
My question is why is this happening and how do I solve it. I know I'm a bit new to asking questions here so if there's anything useful I've left out please let me know. I'd really appreciate any help in solving this.