Report
1 year, 10 months ago.

How to use the RTC AM0805

Hi,

I want to configure the RTC AM0805 with a nRF51822 over I²C. First, I wrote my own driver according the specifications in the data sheet. Just for test purposes I tried to configure the countdown timer to count down 5 seconds in repeat mode. So I set registers 0x18 (0xA2), 0x19 (0x05) and 0x1A (0x05), but I did not get the wished countdown timer. So I experimented a little bit and got the wished result with the following configuration: 0x18 (0xA1), 0x19 (0x05) and 0x1A (0x05). But why do I have to set the countdown timer frequency to 64 Hz when I want to get a timer with a one-second-interval? Are there some failures within the datasheet? Or what am I doing wrong?

Then I experimented a little bit more: I setted register 0x18 with the new value 0x82 to get a timer which counts down from 5 to 0 in a one-second-interval, but I didn't get the expected result. For hours I tried to experiment to get the final result: A countdown timer with a one-second-interval causing a level interrupt when the timer reaches zero. I thought I could get it by setting following registers: 0x10 (0x11), 0x12 (0xE8), 0x18 (0xC1), 0x19 (0x05 for 5 seconds), but I was not successful.

Furthermore, I wanted to restart this timer by simply setting the registers again, but it didn't work.

After I had failed with my own driver I searched a little bit and found a library for the very similar AM1805 (https://developer.mbed.org/teams/Delta/code/AM1805_DEMO/). I adapted a few constants, so that it is hopefully compatible to the AM0805 now. But I still haven't get the countdown timer run in the wanted way. Do you have ideas what could be going wrong?

I'm very thankful for every helpful advise.

Regards, Thomas

During further investigations I read out the status register. I detected that the Oscillator Status Register is set to 0x12 or 0x1A a few milliseconds. Is this the normal behavior or does it indicate an oscillator failure? I'm confused as the OF bit is set either due to a power on reset or an oscillator failure.

posted by Thomas Krahn 03 Aug 2017
Comment on this question
Be the first to answer this question.

To post an answer, please log in.