Program Example

Lets take this into practice and connect a 32,768 kHz crystal to the XTAL1 and XTAL2. On PORT B we connect a 16x2 LCD display for the result. See the circuit diagram below.