Your MCU has built-in ESD protection diodes on the pins, so you could just use those to clamp the voltage. Since they are designed to only protect the device during handling for assembly, you need to put high value resistors in series with the line to limit the current through those diodes and to not overload the driver.
Sizing of resistor should be low enough so that the RC time formed with the diode and pin input capacitance should not be more than 1/3 to 1/5th the required rise time on the signal.
Or you could do the same, but add your external discrete diodes which would be safer.
![schematic](https://cdn.statically.io/img/i.sstatic.net/3ipyr.png)
simulate this circuit – Schematic created using CircuitLab
This is a diode clamp circuit. When the line voltage exceeds the voltage on the other end of the diode, the diode conducts and shorts out the voltage on the line so it can never rise more than one diode forward drop above the power rail. You just need to limit the current through the diode, so it doesn't overheat (and also to not overload the driver). This also works to clamp the line to ground and negative voltages as well (just make sure the diode is in the correct direction).
Schottky diodes are recommended due to their speed and lower voltage drop which clamps the line closer to the power rail voltage. Also, because other diodes will also have a forward voltage high enough that the internal ESD diodes will turn on first, preventing the external diode from ever conducting (ESD diodes are 0.4~0.5 V I think, lower than your typical 0.7 V).
This method also works at high voltages if you want to do something like feed an AC mains signal to a comparator to detect the zero cross and do not want to step down the entire signal with a voltage divider which would make the zero-cross slope shallow and less crisp for digital detection. Needless to say, at such powers you want external diodes and multiple resistors in series to protect against single point failures and other safety measures.