This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.
There was one part missing to complete the software support for my Arduino DataLogger Shield on top of my Freescale FRDM-KL25Z Freedom boardFreescale FRDM-KL25Z Freedom board: support for the Maxim DS1307 RTC (Real Time Clock).
DS1307 on the Adafruit Data Logger Shield (Source: http://www.ladyada.net/make/logshield/design.html)
Things got delayed a bit, as I first needed to get the I2C infrastructure up and running (see this post). But finally, I have things working
. I proudly present: RTC_Maxim!
Maxim I2C Real Time Clocks
The component now supports two different Maxim I2C Realtime Clocks: the DS3232 and the DS1307.
The DS1307 present on the Adafruit Data Logger Shield:
DS1307 on the Arduino Data Logger Shield, on top of the FRDM-KL25Z
The DS3232 is a device I have used in many of my designs:
DS3232 on custom Tower Board
For ‘classic’ (non-LDD) Processor Expert, there has been a component (RTC_I2C_DS1307) for the DS1307 with my custom extensions for the DS3232. But as with many other things: these ‘classic’ components do not work for Kinetis, as with Kinetis there are LDD (Logical Device Driver) components, and they are not compatible. That’s why I ended up implementing my own RTC_Maxim component which works both for the LDD and non-LDD world (see as well this post).
RTC_Maxim Processor Expert Component
The component takes advantage of the GenericI2C component.
Properties of the RTC_Maxim Processor Expert component
As ‘Device’ either the DS3232 or the DS1307 can be selected. The component features an optional Shell interface (ParseCommand()) to the FSShell. Beside of this, it features the usual functions to get/set date and time:
Methods of the RTC_Maxim Processor Expert component
The Read() and Write() methods are used to to access the device non-volatile memory and registers.
Limitations
The component now only supports date and time functions, plus access to the device non-volatile RAM. Support for the other features (temperature sensor, alarm functions, oscillator output, etc) would be a topic for further work. Maybe somebody volunteers to extend the current functionality ?
Component Sources
The component (and sources) can be downloaded from this link: RTC_Maxim.
The FSShell and FAT_FileSystem components have been updated as well with new interfaces.






