0
\$\begingroup\$

This my first time to deal with RTC. I forget to add the crystal oscillator to the OSCI of the PCF8563 chip (I thought it has an internal oscillator). Therefore, I had to insert a 32.768kHz (sine wave) clock source from an external function generator to my PCB. I am using a 1 meter coaxial cable between OSCI pin and the function generator output. The problem is when I read from the RTC it keeps giving me false and random readings. if I try to read the year for example, the reading is faulty and it changes randomly. I checked the I2C signal and it is correct. I also has an EEPROM connected to the same I2C bus and it works properly.

What could be the cause of this false reading? is it the connection of the OSCI from external clock source?

\$\endgroup\$
  • \$\begingroup\$ The RTC just uses the external clock to increase the internal counters used to give you the current date. If your years change randomly, it's almost certain you're not reading out or interpreting the read values correctly. \$\endgroup\$ – Marcus Müller Jul 14 '19 at 12:36
  • \$\begingroup\$ That what I thought too. I checked my reading with oscilloscope and it was changing indeed. I didn't find any explanation. \$\endgroup\$ – Ashraf Almubarak Jul 14 '19 at 12:49
0
\$\begingroup\$

The chip expects a square wave clock signal, not a sine wave. Even worse, a long cable from the function generator to the chip can introduce ringing and noise.

Change your function generator to a square wave. Add a load resistor (50 ohms is common for function generators) directly at the chip input. Verify with an oscilloscope that the signal voltage does not go below ground or above the supply voltage of the RTC.

\$\endgroup\$
  • \$\begingroup\$ Actually, The chip expects a sine wave input biased at Vdd/2 or as stabilized BY internal R feedback in the Colpitts design and/or different Vt for Pch and Nch. But a square wave is also acceptable. Proximity of OSCI input to source affects noise ingress to this >1MOhm input impedance, so beware of crosstalk on I2C and use a lower R if in doubt. probably the OP forgot to add Vdd/2 DC bias or AC couple to internal self bias feedback when enabled. ** after all the Xtal is a BPF** \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jul 14 '19 at 15:07
  • \$\begingroup\$ @Elliot, Their design notes said either square or sine wave could be used. I believe that square wave will have more noise than the sine wave. I have verified my level of voltages and it is on the limits stated by nxp notes. The question is could this affect the reading of the registers inside the RTC? \$\endgroup\$ – Ashraf Almubarak Jul 14 '19 at 17:25
  • \$\begingroup\$ @SunnyskyguyEE75 you suggest that the crosstalk in I2C cause this faulty readings? Do you mean small pull-up R?? I am using 5.6K or you mean something else? for the DC bias it is added, if it isn't the RTC will not work. \$\endgroup\$ – Ashraf Almubarak Jul 14 '19 at 17:31
  • \$\begingroup\$ Did U bias the 32kHz signal? \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jul 14 '19 at 22:27
  • \$\begingroup\$ @SunnyskyguyEE75, yes with the 0.5 V d.c \$\endgroup\$ – Ashraf Almubarak Jul 15 '19 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.