I am trying to use the inbuilt ADC of the Arduino Due to measure voltage signals. The frequency range I'm interested in measuring is up to about 30 kHz.But I'm observing a strong capacitor behaviour as I increase the frequency ( from 10kHz onwards this is quite visible).
This is most visible when measuring a square wave. When I get close to 30 kHz the signal looks exactly like the text book capacitor charge/discharge wave and nothing like a square wave. Even at around 15 kHz, the square wave looks more like a sine wave/ ramp signal than a square wave.
Based on the behaviour my guess is that a capacitor in the Arduino Due ADC is causing this (as the frequency increases, the capacitor cannot charge/discharge fast enough). But I'm not sure whether I'm correct about this. Even if I'm correct, how can I fix this?
Any help would be much appreciated.
Also NOTE that As the frequency increases, the amplitude of the observed wave decreases ( I couldn't show this in my drawing). Think this again links back to the capacitor charge/discharge speed behaviour.
My Vin circuit : I tested by adding a voltage follower at the right most end(not shown on the schematic), but that made no difference.