English
Language : 

PIC18LF24K Datasheet, PDF (285/594 Pages) –
PIC18(L)F26/45/46K40
23.0 ZERO-CROSS DETECTION
(ZCD) MODULE
The ZCD module detects when an A/C signal crosses
through the ground potential. The actual zero crossing
threshold is the zero crossing reference voltage,
VCPINV, which is typically 0.75V above ground.
The connection to the signal to be detected is through
a series current-limiting resistor. The module applies a
current source or sink to the ZCD pin to maintain a
constant voltage on the pin, thereby preventing the pin
voltage from forward biasing the ESD protection
diodes. When the applied voltage is greater than the
reference voltage, the module sinks current. When the
applied voltage is less than the reference voltage, the
module sources current. The current source and sink
action keeps the pin voltage constant over the full
range of the applied voltage. The ZCD module is
shown in the simplified block diagram Figure 23-2.
The ZCD module is useful when monitoring an A/C
waveform for, but not limited to, the following purposes:
• A/C period measurement
• Accurate long term time measurement
• Dimmer phase delayed drive
• Low EMI cycle switching
23.1 External Resistor Selection
The ZCD module requires a current-limiting resistor in
series with the external voltage source. The impedance
and rating of this resistor depends on the external
source peak voltage. Select a resistor value that will
drop all of the peak voltage when the current through
the resistor is nominally 300 A. Refer to
Equation 23-1 and Figure 23-1. Make sure that the
ZCD I/O pin internal weak pull-up is disabled so it does
not interfere with the current source and sink.
EQUATION 23-1: EXTERNAL RESISTOR
RSERIES = 3-V----P--1-E--0-A--–-K--4
FIGURE 23-1:
VPEAK
EXTERNAL VOLTAGE
VMAXPEAK
VMINPEAK
VCPINV
 2016 Microchip Technology Inc.
Preliminary
DS40001816C-page 285