One of my colleagues is designing a digital clock with 7-seg displays. The clock function is shouldered by a Real-Time Clock IC, PCF8563.
The RTC IC is clocked with a 32.768kHz crystal and its external caps (one cap is a fixed one and the other one is a trimmer for frequency trimming). The trimming is guaranteed by measuring 1Hz output (test frequency) function of the RTC IC using a precision counter/frequency meter. By the way, the communication protocol between MCU and the RTC IC is I²C with a speed of 400kHz.
Instead of using 7-seg display modules (like this one), he decided to use discrete 0603 case SMD LEDs for 7-seg display effect (this is important) and cost-effectiveness. He placed these LEDs on one side of the PCB, and the other side is full of other components (i.e. regulator, MCU, backup battery, RTC IC, driver ICs etc). The PCB is made from 1.6mm FR4 material.
The displays are multiplexed with a frequency of 100Hz (min). Before the LEDs light up, test frequency measured from RTC IC's output can be trimmed to 1.00000Hz. But, once the MCU starts multiplexing the LEDs, test frequency shifts to 1.5Hz or even 2.5Hz and stays unstable.
TRIAL & ERRORS
Grounding the crystal's outer metal case, adding ground areas, adjusting multiplexing frequency did not work. It's quite interesting that using 7-seg display modules or separating RTC IC and its external components (i.e. crystal and caps) to another PCB does not cause any problem(s).
Despite using a separate PCB for the RTC block or using 7-seg display modules solves all the problems, he is restricted with using only one PCB housing all the components. So, what can cause this frequency shifting problem? What should be done to deal with this?