Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
3 years, 3 months ago.
How to use the RTC AM0805
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.