[sdiy] CV input op-amp circuit

Brian Willoughby brianw at audiobanshee.com
Sun Dec 6 05:38:02 CET 2020

On Dec 5, 2020, at 17:29, Mike Beauchamp <list at mikebeauchamp.com> wrote:
> On 12/5/20 4:50 PM, Brian Willoughby wrote:
>> That sounds like a good idea. I briefly tried using external clamping diodes for a Euro switch panel, but something didn't work out and I ended up not populating those parts.
>> One thing you might have to look out for is that clamping activity will still cause spikes on the supply rails.
>> Brian
> Very interesting that you had some sort of problem with the diodes.

I can't remember the details, but I think that I was trying to make the panel flexible since I might reuse it for 5V or 3.3V - these were just momentary buttons and rotary encoders with pull-ups. When the Zener clamps didn't work, I just pulled them and stopped trying to figure out what mistake I'd made. My symptoms were that the processor never saw any change in state for the switches. The processor itself always started and responded to the debugger.

> I've been unsuccessfully trying to debug a problem I've been having where my Teensy 3.2 fails to power on about 50% of the time (the cystal oscillator doesn't oscillate) and it seems to go away completely when I remove two BAT54S's that are protecting some op-amp outputs that are going into ADC pins.

Sometimes crystal circuits can be tricky, and there might be a problem there that's separate from the protection diodes.

In general, a crystal likes a low (e.g. 100Ω) series resistance on the driving side (output from CPU) and select-matched capacitors (a pair). For the PIC, Microchip gives a table to select the right capacitance for each supported crystal frequency. You can get by with the wrong capacitance (16pF to 32pF), but the slightest change in the phase of the moon will cause troubles. I grabbed the main K20 data sheet, but didn't see a recommended circuit.

Maybe you can beef up the crystal circuit and make it more robust. I now encircle my crystal with a ground trace to prevent interference - in or out of the oscillator.

> These inputs aren't open to user-voltages so over-voltage scenarios aren't expected, but the BAT54S's are there to protect the Teensy 3.2 in case something goes wrong.
> Unless I can figure out WHY this is happening, I'm probably just going to remove the diodes and add current limiting resistors.

If that works, then it works. ;-)

> My guess is that the voltages spike on start-up and somehow freaks the teensy's crystal out.. I know, very technical :)
> I've captured the start-up on my scope though, looking at the ADC inputs and all voltages and I see nothing different from when the Teensy fails or succeeds to power-up.

It may be unrelated, but sometimes leakage currents on an MCU GPIO pin can power the chip through its internal protection diodes. While this may not seem like a problem - *free power* - it can cause issues if the MCU never fully resets. Without a full reset, the chip can get into an indeterminate state.

In your "fails 50% of the time" are you able to wait for power to completely drain from the supply rails as well as all other parts of the circuit? Sometimes a resistive load on supply capacitors can help drain them when you want to recover from a user that flips the power switch too quickly.

I'm not quite sure how your *external* protection diodes could cause any problems like this, but it's potentially similar to other problems.

> Mike


More information about the Synth-diy mailing list