DAC0 stop working in Arduino Due

Hello everyone,
Even though there are similar topics, I have a specific question about my setup. My DAC0 was working fine but suddenly stopped after about a week of use with my Arduino, sadly. It might be burned out based on previous topics. I was using the DAC0 to provide an analog voltage input to a focus tunable lens driver, which has its own microcontroller and operates within a 0-5V analog input range with 10-bit resolution.

To protect DAC0, I connected a diode between both the lens and DAC0 (cathode side) and ground (anode side), hoping any excess voltage would be shunted to ground. Despite these precautions, my DAC0 has burnt out.

What can I do to ensure my remaining DAC1 be safe? I've read recommendations for placing a 1k-2k resistor in series for speaker protection, but I'm concerned about the resistor introducing errors. Additionally, since the DAC is an output, I'm unsure why it needs protection as we usually protect inputs this way. Any advice on this would be greatly appreciated!

With the diode to GND you protect the pin from negative voltages. If you think that the problem could be voltage spikes you could add also another schottky diode to Vcc, to redirect spikes higher than 5V to Vcc. Something like this:
image

You could also add a small resistor, about 100Ω, if the inpedance on the other side is high.
But the question is also why do you have these voltage or current peaks. You could try to put more big capacitors in the power rails, and overcurrent protection there, etc.