chipKIT® Development Platform

Inspired by Arduino™

External RTC

Created Mon, 19 Sep 2011 21:00:54 +0000 by chumann


chumann

Mon, 19 Sep 2011 21:00:54 +0000

I'm trying to find any libraries / mean of using an external RTC like the Chronodot with the UNO 32. Has anyone been successful in using an RTC with the UNO32?


avenue33

Tue, 20 Sep 2011 07:41:24 +0000

Yes, I'm using the I2C DS1307 with the Arduino Uno board and plan to port it to chipKIT.

The default [color=#0000FF]int[/color], [color=#0000FF]long[/color] types should be made explicit as [color=#0000FF]int8_t[/color], [color=#0000FF]uint8_t[/color], [color=#0000FF]int16_t[/color], [color=#0000FF]uint16_t[/color].

Stay tuned ;)


chumann

Tue, 20 Sep 2011 18:09:52 +0000

Thanks for the response. Standing by with baited breath!


avenue33

Tue, 20 Sep 2011 20:37:03 +0000

You can breathe now :!:

Don't forget the 4,7 kΩ pull-up resistors, otherwise the DS1307 won't be recognised.

[color=#FF0000]• Update Release 4 issued Nov 21, 2011 available at the :arrow: GitHub repository.[/color]


chumann

Tue, 20 Sep 2011 21:24:25 +0000

Thanks so much for that. Just to clarify; I need 2, 7k resistors in series connected between 3v and the SDA as well as the SCL lines?


avenue33

Wed, 21 Sep 2011 05:53:05 +0000

The DS1307 requires 5V.

4,7 kΩ is a standard value for I2C pull-up resistors.

For more information, please refer to the datasheet.


Rob Drizzle

Sun, 15 Jan 2012 00:33:04 +0000

For some reason my year only shows up as "220" instead of 2012 in the main example. What can I do to fix this. Thanks.

Oh also, just an FYI the day and month are swapped when setting the RTC.


avenue33

Sun, 15 Jan 2012 08:18:07 +0000

For some reason my year only shows up as "220" instead of 2012 in the main example. What can I do to fix this. Thanks.

Please update to release 4 issued Nov 21, 2011 available at the :arrow: GitHub repository.

Oh also, just an FYI the day and month are swapped when setting the RTC.

This is European date format: day/month/year.

Feel free to modify the code or use

uint16_t year();
  uint16_t month();
  uint16_t day();

to obtain US date format: month/day/year.

Best regards,


Rob Drizzle

Sun, 15 Jan 2012 15:01:41 +0000

Very Good... Thanks for the hard work, Just what I needed.


Rob Drizzle

Sun, 15 Jan 2012 15:13:51 +0000

Wait a minute... I'm kinda confused. It seems that the external RTC lib and the on-board RTC are now one library? Does the pic32_RTC_main example still use the on-board RTC? I really just need a lib for the ds1307, because to me, it does not make any sense setting the on-board RTC using an external RTC when I could just use the external RTC anyway.


avenue33

Sun, 15 Jan 2012 15:54:57 +0000

Two clocks, two libraries:

  • ds1307 : I2C_Clock library
  • PIC32 RTC : pic32_RTC library

Rob Drizzle

Sun, 15 Jan 2012 17:22:12 +0000

Thank you... I'll play with it later.


Rob Drizzle

Tue, 17 Jan 2012 02:50:44 +0000

Works perfectly... What threw me off was the I2C clock library file were in one of the example code directories.


Jacob Christ

Sun, 24 May 2015 16:21:45 +0000

[color=#FF0000]• Update Release 4 issued Nov 21, 2011 available at the :arrow: GitHub repository.[/color]

Is there a repo for the I2C library?

EDIT: I found the code in the repo, two libs one repo. But it doesn't seem to compile out of the box, nor the does the RTCC code seems to count on a Fubarino SD

Jacob