AD_MSG
HI_THERE!

POP_UP_MESSAGE_CONTENT

US_MESSAGE
SEND_MESSAGE
+86 13430584894

SD2068 FAQ

  • Dec 05,2024
  • 67 VIEWS
1. Q: Why is SD2068 not accurate when it leaves?
    A: 1. Check if the reference time is accurate. You can use our company's online timing tool "About Time" to calibrate your computer;
        2. The low internal battery level causes the clock oscillation circuit to stop working (can be confirmed by testing the voltage of the TEST pin);
       3. Check if the digital adjustment register has been reset to zero;
       4. The high or low ambient temperature will affect the accuracy of travel time;
       5. Inappropriate matching capacitor (see 11. Q).

2. Q: Why doesn't SD2068 return an ACK and all the values read are 0xFF?
    A: 1. Refer to the application reference circuit in the RTC chip manual (3.3V and 5V application circuits are different);
        2. The SDA port is not equipped with a pull-up resistor (usually 2-10K);
        3. SCL and SDA port definitions are reversed;
       4. IO port is reused;
       5. The device address of SD2068 is not set correctly, and its device address should be 0x64;
       6. There are address conflicts between other devices on the I2C bus and SD2068 devices;
       7. There are many issues with the communication program of I2C, such as microcontroller port configuration, non-standard timing, fast bus, IO reuse, etc., as shown in the appendix;
      8. RTC is damaged.


3. Q: Why can't I detect SD2068 and return an ACK when using the emulator for single step debugging?

    A: Because the I2C bus of SD2068 has a 0.5s timeout automatic reset function.


4. Q: Why is there a jump in time when reading from RTC. If it jumps directly from 9 seconds to 16 seconds, and it will be greater than 60 seconds?

    A: RTC uses BCD code for timing, where 0x10 represents 10 seconds in decimal. When viewed in decimal, it shows a jump from 9 to 16 (0x10=16).


5. Q: Why do I sometimes read the time in garbled characters?

    A:1. SD2068 has completely lost power, and the time it reads when powered on again is a random number (possibly garbled);

      2. The VBAT foot of SD2068 may also read garbled characters when suspended;

      3. The overall speed is too fast or there are non-standard aspects in the timing of the communication program (see appendix);

     4. Control the multiplexing of the IO ports of SCL and SDA;

     5. The SDA port of the chip is not equipped with a pull-up resistor.


6. Q: Why do hours run until 25 o'clock, 26 o'clock?

    A: The 12/24-hour clock is not set correctly. Set the 12/24 hour clock at the highest bit of the hour register (02H).


7. Q: Why does the hour display 90 o'clock, 91 o'clock?

    A: After reading the hourly data, the highest bit (12/24 hour control bit) was not masked.


8. Q: When the clock chip generates an interrupt output, is the INT pin high or low?

    A: The INT port is an N-channel open circuit output port, usually connected to a pull-up resistor during use. When there is no interrupt output, it is high level, and when an interrupt occurs, it becomes low level.


9. Q: Can the INT pin of the clock chip be suspended when not in use?

    A: It's possible.


10. Q: What is the reason why SD2068 does not vibrate?

      A:1. There is leakage between the two legs of the crystal oscillator due to wiring, contamination, condensation, and other reasons. Please wash and dry before trying again;

         2. The wiring of the crystal oscillator circuit is too long. When wiring on the PCB, the wiring of the crystal oscillator circuit should be as short as possible and as close to the IC as possible;

        3. The load capacitor or matching capacitor does not match the crystal oscillator or there is a problem with the quality of the capacitor (please refer to 11. Q);

        4. The PCB board is damp, resulting in impedance mismatch and inability to vibrate;

        5. There is a problem with the quality of the crystal.

      

11. Q: What size matching capacitor should be used for SD2068?

      A: Crystals with a load capacitance of 6pf typically use a matching capacitance of 7pf; A crystal with a load capacitance of 12.5pf typically uses a matching capacitor of 15pf.


12. Q: The power consumption of SD2068 is very high, and the backup battery runs out quickly?

       A: Under normal circumstances, the power consumption of SD2068 is approximately 1uA.

           1. The pull-up resistor is connected to the battery terminal. You can refer to the application reference circuit introduced in the SD2068 manual;

           2. It is possible that the chip has been damaged. Please replace the chip and check if it is functioning properly.


13. Q: Why can it be set up on February 30th? Can't the chip be fault-tolerant?

      A: The SD2068 chip does not have fault tolerance function, please ensure the writing time. Setting non-existent time or date data will cause the counter to fail to count properly.


14. Q: After setting the year, month, and day for SD2068, can it automatically adjust the week?

      A: The week system corresponding to the calendar cannot be automatically adjusted, and can be                    achieved through certain algorithms. Below is a commonly used formula:

          A: The most common formula:

          W = [Y-1] + [(Y-1)/4] - [(Y-1)/100] + [(Y-1)/400] + D

          Y is the number of years, and D is the cumulative number of days on this day in the year, which is                the day on which this day is in the year.

          B: The best formula to use is the Zeisler formula:

          W = [C/4] - 2C + y + [y/4] + [13 * (M+1) / 5] + d - 1

         C is the century minus one, y is the last two digits of the year, M is the month, and d is the day.                   January and February should be calculated based on the 13th and 14th months of the previous                   year, and both C and y should be calculated based on the previous year.

          The [...] in both formulas refers to taking only the integer part of the calculated result. What is the                remainder of W divided by 7, which is the day of the week. If the remainder is 0, then it is Sunday.


15. Q: How to determine from software that SD2058 has lost power?

      A: Read the 0FH register and check if the lowest bit (RTCF) of the register is 1. If it is 1, it indicates that SD2068 has lost power.


16. Q: Why can I read the time of SD2068 but not write the time?

      A: SD2068 has three built-in protection soft locks (WRTC1~WRTC3), which need to be set to position 1 before writing to the register. The unlocking order for setting 1 is: WRTC1->WRTC2, WRTC3; After the write register operation is completed, protect the register data with these three lock positions 0. The order of locking with 0 is WRTC2, WRTC3->WRTC1. You can refer to the demo routine on the relevant official website for details.


Appendix: Examples of Program Issues

When switching port directions, a STOP signal was introduced.

     This function sets the input and output of the IO port from the beginning, and there was no error. SCL was low before this operation, but some microcontrollers set the SCL port to output, which causes SCL to become high. The problem is that when SDA is set as input, SDA will also change from low to high, forming a STOP signal. The bus is immediately released, and the previously sent data is cleared, so we cannot wait for an ACK response.

     The SCL line has only one direction and is always the output. It only needs to be set once in the START function. The modification method is to mask the statement DDRA |=0x08.


2.Introducing START when sending the STOP signal may also cause the I2C slave device to malfunction.

     The function that sends the STOP signal above doesn't seem to have any errors, but if the SCL line is in a high state before calling this function, a START signal will be generated when the function starts calling. A safer approach is to first lower SCL, then lower SDA, and swap the positions of SDA1_CLR and SCL1_CLR.


3. Familiarity with the I2C protocol bus protocol resulted in a failure to read the specified address register.

The above program seems to have no problem, but in fact, it does not understand the I2C transmission protocol. It assumes that after sending the read command, sending another address will read the data in the specified register. The correct timing diagram is as follows:

The address of the register is not sent out with a read command, but with a write command. The correct way to write it is as follows:

4. If the holding time of the start signal, data establishment, or data retention is too short, it may cause the bus to fail to respond.

The problem with the above program is that the SDA data establishment time is too short. For some MCU with fast processing speed, data is sent out and RTC cannot respond. The correct approach is to set p_Block_CLK=1; Add a delay before:

5. Device address error causing read/write register failure.

The above program is obviously an error in understanding the device address and is not familiar with the I2C bus operation process, and has not figured out the read and write operations of the device address.