A RV8803 RTC i2c based interafcing library for the new 0-series and 1-series ATtiny and ATmega based uCs.
Note: Method implementations are very specific to my use-case for a project. Thus lot of capabilities of the RTC is not implemented as I didn't need them.
Tested in ATTINY1607 running on megaTinyCore compiled in Arduino IDE 1.8.13. A lot of inspiration and methods were borrowed from Sparkfun's RV8803 Libray.
I was working on a project where I needed to use a RTC. I needed to use very low power uC (So I stumbled upon the new ATTINY series uCs) in a very small physical footprint. Usual RTC clocks are rather big for my purpose and current consumption metrices, so I stumbled upon RV-8803 RTC, from microcrystal. Upon looking further on the internet, above mentioned, sparkfun library came up in focus. But the library uses wire
library under-neath for it's i2C communication for reading and writing, to & from the RTC. The library is okay to be used in typical arduino projects but it is very memory heavy, bulky and not so efficient for my purpos.
So I set to rewrite some of the useful methods from the sparkfun library, replacing wire
library parts with custom, more efficient for new ATTINY's I2C needs, the TinyMegaI2C.
NOTE:
- I have not implemented all the methods as I do not need them and they will save me memory and thus current. But feel free to extend on it. I will definitely extend the funstions as per needed, in next releases. 🤗
- I have tested this library for ATTINY1607, compiled using Arduino IDE 1.8.3. But should work for others in the same series. 😕
- Do not forget the PULLUP Resistors on the I2C Bus. They are there for a reason 🤓
Prerequisite: TinyMegaI2C
Then it is Standard Arduino Library Installation method:
Take a look in the examples to get the ideas about the methods implemented.
- Print Date
- Set Hundredths
- Timestamp
- Alarm interrupts
- Countdown interrupts
- Periodic Interrupt
- Fine Tuning RTC.
MIT Licence.md