Microchip application note, AN521 "Interfacing to AC Power Lines",
provides a number of guidelines for implementing low-cost, zero cross circuits
by relying upon the parasitic ESD diodes in the I/O pins. These guidelines have
been used successfully for many years, but, with the increase in analog functionality
on the microcontrollers, the simple world in AN521 is now much more complex.
Many recent devices are pin-compatible with older devices and can be inserted
into an older socket, but the application can now exhibit strange behaviors unless
the interaction with the new analog features are understood and avoided