Don't expect EN011202 or
AN521 zero crossing detection to work well or at all on a more modern PIC, though if you get lucky it may work on some pins ...

Read
TB3013 to find out why, noting that more modern devices are even more sensitive to current through the lower protection diodes, then resign yourself to adding a BAT54S (or similar) dual series Schottky diode to your BOM to clamp the ZCD input and prevent *any* substrate charge injection, or at the very least providing a footprint to add such clamping later even if you believe your design uses a 'safe' digital only pin far enough away on the die from the oscillator(s), voltage reference and any other analog features, for when you get the nasty surprise of your oscillator frequency going way out of spec or your PIC locking up for lack of it!
