Hi,
I just opened up my HC RTC from May 2014, and had it working in minutes with a Micromite MkII with I2C.
The MMBasic is smart and knows the type of RTC connected, avoiding all of the frustrating (=Arduino headers, libraries, compiler)

I2C setup.
The Micromite MkII is a home programmed (OS firmware, one-time-only using a PICkit3 or 3clone), open source, Microchip PIC32MX170 MIPS 32-bit CPU, 48 MHz, and 10uF MLCC Vcap, that is powered by a UART dongle at 3.3v maximum (use a 5v USB to 3.3 regulator if needed) and uses a console terminal at 38400 baud for self-generated editing, debugging and load/save to PC
See
http://geoffg.net/micromite.html for details
I would recommend a Hobbycomponents
Model HCMODU0051 Silicon Labs CP2102
3.3V USB to UART serial interface module adaptor to power and communicate. An extension USB cable may be required or HC dupont jumpers.
or
Model HCCABL0015 - USB to RS232 TTL Serial Interface Cable - but requires a 5v to 3.3v LDO regulator (I use MPC1700-330) and two filter capacitors to safely power the Micromite and peripherals, the cable however is a bonus.
This is all the code needed to set, read the DS1307 RTC and syncs the Micromite MkII to real-time every 12 hours.
The internal MMII Basic clock can drift +- 3 seconds per hour.
Code: Select all
'this will set the RTC to 2015 July 24 14:01:02 PM and can be done from the command line prompt.
RTC SETTIME 15, 7, 24, 14, 01, 02
This will sync the internal pseudo RTC to the real RTC.
Code: Select all
RTC GETTIME ' get and set the internal time at startup
SETTICK 12*3600*1000, SetTime, 4 ' interrupts set to 12 hours * 3600 seconds per hour * 1000 ticks per second
Do
'< normal user program goes here>
PAUSE 1000
Print Date$, Time$ 'to console UART Dongle to Teraterm or Putty
Loop
SetTime: ' interrupt called every 12 hours
RTC GETTIME ' reset the internal MM Basic time to RTC
IRETURN