I'm reading a schematic (done by a former employee) with a microcontroller, and I came across this circuit:
What is the function of D1?
Also, I think that R2 isn't necessary, because the control input come from another GPIO that always has 1 or 0 as its output.
Besides this one, there is another block of this same circuit but connected to the RESET pin of the microcontroller. This part of the circuit is used to flash the microcontroller via ISP.
R1 = 47k R2,R3 = 10k D1 = 1N4148