12V input on microcontroller pin
I would try a resistor divider solution like shown below. 



Select the resistor ratio so that the divided voltage is at the proper level for the MCU when the input is at its nominal voltage. The zener diode voltage is selected to clamp the MCU input when the input goes above the max input. The zener will also protect the MCU if the input happens to go negative.

This solution will work great for the relatively low frequency range that you have specified.