Close

Real Time Clock (RTC) Error - Fixed

A project log for 3-Chip Z80 Design

Combining a Z80 retro design with a modern PSoC CPU.

land-boardscomland-boards.com 11/01/2019 at 14:010 Comments

The RTC is running too fast. Weird. There's not much to it. I wonder if the loading caps are the wrong values?

Debugging the RTC clock via taking over the DAC output pin and sending out the 32.768 KHz clock.

Running frequency is 190.912 KHz. That is 5X the 32.768 KHz crystal. 

Touching the crystal shifts the frequency to 32.768 KHz temporarily.

The crystal is an Abracon part, PN: AB38T-32.768KHZ.

Load Capacitance: 12.5 pF

I do have two load capacitors. I wonder if they are correct? The PSoC datasheet has:

Right now I have 8 pF caps so I definitely have too much load capacitance. Not sure what the trace capacitance is. I did remove the ground fill below the crystal so it would be less. This note is easier since they do the math.

Looks like I need to change to 18 pF caps. 

Clock works

Replaced the caps with 18 pF parts and the frequency is now stable AT 32.7 Khz. Can't measure the accuracy too closely with the scope frequency counter but it says 32.7797 Khz which is reasonably close to the 32.768 Khz value. It is 0.03% accurate (I doubt the scope is that accurate). Perhaps the difference is between the 18 pF parts I used and the 19 pF from the calculation above.

The BASIC code to set and read the timer is documented here.

Discussions