Oscillating capacitor charging and discharging principle