Implementing a 32-kHz ECO Interface with PSoC® 4100/PSoC 4200 – KBA95848
Question: How can we implement a 32.768-kHz external crystal oscillator (ECO) interface with PSoC 4100 and PSoC 4200 series devices?
PSoC 4100 and PSoC 4200 series devices do not have built-in ECO circuitry that is available in PSoC 3 and PSoC 5LP. However, you can implement a 32.768-kHz crystal interface circuitry inside a PSoC 4 device using an internal comparator.
The following schematic (Figure 1) can be used for PSoC 4100 and PSoC 4200 parts.
Figure 1. PSoC Creator Schematic Diagram for Crystal Interface
The schematic shows that this solution uses three GPIOs. In firmware, you just need to start the Comparator using Comp_1_Start().
The design is a Pierce oscillator topology, where the comparator acts as an inverter. The crystal to be used is a 32.768-kHz watch crystal such as CFS308 Crystal manufactured by Citizen Finetech Miyota. A feedback resistor R1 is used to start oscillation. The series resistor R2 is used to limit the current to the crystal. The 180-degree phase shift provided by load capacitors C1 and C2 along with the negative gain from the inverter results in a positive-loop gain that produces oscillations.
It is recommended to use the same values for the passive components as shown in Figure 1. These values have been tested for different supply voltages and can produce a sustained 32.768-kHz clock.