max038 pic
Well, here are a few comments that I have:
1. Generally I use a resistor in series with all outputs that go outside the box. In your case, I would use resistors in series with the MAX038 output, U102 output. You never know what these will be connected to in the real world.
2. I believe the way you want to switch capacitors is not going to work well, especially for high-frequency operation. The cap voltage goes both positive and negative, so the PIC diodes will probably clamp it, especially for negative values, resulting in some odd waveforms (that's what I think, anyway).
3. I don't really understand the role of gate (11,12,13) of U102. Voltage sensing?
4. I would not leave input 5 of U102 open. Use a pullup/ pulldown for when the input is connected to the ext. connector.
5. I do not see GND pins on MAX038 connected to GND (2, 6, 9, 11, 18, 15).
6. I am sure you know this, but the PIC should be powered by the programmer while it's being programed and you always power it from the power source, never from the programmer. It's best to let the programer to power the PIC since it varies the voltage and checks the program from min to max voltage. It's safer that way, you avoid surprises in the future. You may consider adding a jumper in series with PIC's Vdd and bring the PIC Vdd pin to your programming header. When programming the PIC, remove the jumper so the programmer does not have to power the rest of the circuit. (If it does, you may get a Vdd overcurrent error).
Regards,
VVV