This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ32000: Oscillator Failure

Part Number: BQ32000

Hello,

I would like to use the BQ32000 with a Raspberry Pi 3 Model B (Raspbian Buster).
I put everything together and the I2C communication seems to be ok, but it is not possible to read the time from the chip.
I get the following message when loading the module:

bq32k 1-0068: Oscillator Failure. Check RTC battery.
bq32k 1-0068: Enabled trickle RTC battery charge.
bq32k 1-0068: rtc core: registered bq32k as rtc0

I already tested a new chip and another crystal with the same issue.
I use the following crystal:
ABS07L-32.768KHZ-T
abracon.com/.../ABS07L.pdf
www.digikey.com/.../3915230

Do you have any idea what’s going wrong?

pi@raspberrypi:~ $ sudo hwclock -D -w --verbose
hwclock: use --verbose, --debug has been deprecated.
hwclock from util-linux 2.33.1
System Time: 1569685463.067748
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1569685156 seconds after 1969
Last calibration done at 1569685156 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
RTC type: 'bq32k'
Using delay: 0.000000 seconds
missed it - 1569685463.082688 is too far past 1569685463.000000 (0.082688 > 0.001000)
1569685464.000000 is close enough to 1569685464.000000 (0.000000 < 0.002000)
Set RTC to 1569685464 (1569685463 + 1; refsystime = 1569685463.000000)
Setting Hardware Clock to 15:44:24 = 1569685464 seconds since 1969
ioctl(RTC_SET_TIME) was successful.
Not adjusting drift factor because the --update-drift option was not used.
New /etc/adjtime data:
0.000000 1569685463 0.000000
1569685463
UTC

pi@raspberrypi:~ $ sudo hwclock -D -r --verbose
hwclock: use --verbose, --debug has been deprecated.
hwclock from util-linux 2.33.1
System Time: 1569685173.482154
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1569685156 seconds after 1969
Last calibration done at 1569685156 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
ioctl(3, RTC_UIE_ON, 0): Invalid argument
Waiting in loop for time from /dev/rtc0 to change
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
...synchronization failed


Kind regards,

Denny

  • Hi Denny,

    The first error message is expected. The OF flag is set on device power-up or oscillator failure. The OF bit will not automatically change and you will need to clear the bit through the serial interface.

    Based on the code you provided, I'm not sure why the read failed. It seems there was an invalid argument on the read command.

    Kind regards,
    Lane

  • Hi Lane,

    Thanks for your reply.
    It is really necessary to change the OF bit manually? I think this will be done by the driver.
    Could you please advise how to clear the OF bit?
    I can stop and start the oscillator with the help of i2cset, but not change the OF bit.

    Kind regards,

    Denny

  • Hi Denny,

    You would not need to change the bit if you do not want to use the OF flag.

    To clear the bit, simply write it to zero. This can be done when you are setting the time during initial configuration.

    If you cannot change the OF bit, that may be an indicator that your oscillator is not behaving properly.

    Kind regards,
    Lane

  • Hi Lane,

    do you have any idea what can cause such an issue with the oscillator?
    I already tested with a second type of a known working crystal and a new chip - same issue.

    Kind regards,

    Denny

  • Hi Denny,

    I'm not certain what is causing an issue yet, we will have to keep debugging. Do you observe it on other boards or with other devices?

    Please verify that the oscillator is indeed oscillating by checking on an oscilloscope. Once you have confirmed it, clear the OF bit, then reread the OF bit to make sure that no oscillator failure has occurred.

    Kind regards,
    Lane

  • Hi Lane,

    I made a custom PCB and two test PCBs causing in the same issue.

    I already checked the PINs OSCI and OSCI with an oscilloscope, there is only a voltage of a few millivolts and no oscillation detectable.

    I am not sure how to clear the OF bit, because I am no coder. I use the I2C tools for Linux and can read and write to the registers. But when I write the value 0 to bit 7 of the seconds register nothing changes.

    Kind regards,

    Denny

  • Hi Denny,

    Thanks for the update. Does your crystal meet the requirements in the recommended operating conditions?

    It appears that the there is no oscillation, which would explain the problem. The first thing that must be done is get the oscillator working. When measuring the OSC pins using an oscilloscope, it is recommended to use a high-impedance, low capacitance probe so that the probe does not stop the oscillator.

    The OF bit is register 0x01 bit 7 (minutes register), you write the bit with 0 to clear it. You have wrote the STOP bit to zero, which would allow the oscillator to behave in normal operating mode, but this won't have an impact if the crystal/oscillator is not working for some other reason.

    Kind regards,
    Lane

  • Hi Lane,

    There was a problem with the crystal.
    I tested a crystal from another manufacturer with the same technical specifications and it worked right away.

    Kind regards,

    Denny