Page 1 of 1

16f18877 internal Zero Cross Detector

Posted: Mon Feb 02, 2026 3:40 am
by hippalator
The 16f18877 has a Zero Cross Detector as one of its CIP.
I cannot find this component within FC.

Is the ZCD accessed by utilizing the "CODE" command icon within the flow chart?
Or am I missing something?
Did a search within FC and no results.

Re: 16f18877 internal Zero Cross Detector

Posted: Mon Feb 02, 2026 6:54 am
by mnfisher
Yes, you would need to use some C to enable the ZCD module - this would be in either a code block or in a custom interrupt.

See section 21 of the datasheet.

It looks relatively straightforward - but if using it to measure mains zero crossing then great care is needed with the wiring (not something for a breadboard ⚡)

The syntax REGISTERbits.FIELD = n (for example ZDCONbits.EN = 1) or REGISTER = n to set the whole register is used.

Martin