How to safely charge a capacitor with a GPIO pin of an Arduino/Raspberry pi/ESP8266/Attiny
I do this frequently for building cheap charge pumps. Here is an example...
https://wp.josh.com/2017/03/20/blinking-blue-powering-a-3-7-volt-led-from-a-2-4-volt-coin-cell-with-a-0-02-charge-pump/
The GPIO pins on AVR chips are very robust and I've never had any issues across thousands of commercial units over years of use.