The main difference between these two chips is the ability of DS1337 to handle (set, trigger) an alarm. Otherwise, both have similar pin configurations, both "talk" I2C, and both use a 3V coin battery (DS1307 only as backup, DS1337 as the only power source).
Many others have included DS1337 on their boards and wrote libraries for this chip. I thought I should give it a try myself, especially because of the alarm capability. The easiest way was to modify an Wiseduino board, by cutting 3 traces and adding 2 wires, as shown in this image:
The cuts are shown with yellow lines, the wires are light blue. The rightmost cut is on the back of the board.
Updated Apr 17/2010
After I started the actual work, I realized that, since DS1337 is powered by the 3V coin battery, voltage level adapters (on SCL and SDA lines) need to be used between the clock and a 5V-powered Wiseduino. So I decided to power Wiseduino with 3V as well (2xAA batteries). This means the frequency cannot be 16MHz (according to ATmega168/328 datasheet); so I installed an 8MHz resonator instead. So far so good. I am able to upload the DS1337 sketch and read back the time. Current consumption is a under 5mA.
Here are a few other things I did to make this work:
- on Wiseduino, I am using an ATmega168 with the bootloader, instead of the 328;
- I changed boards.txt to accommodate the 8MHz working frequency:
- tried unsuccessfully JLuciani's DS1337 library; it seems to require/use a different set of "wire" files than those coming with Arduino IDE 18; confusion ensues; files and functions need to be renamed etc etc; I just gave up;
- tried, with limited success, xSmurf's DS1337 library; there seem to be multiple versions of the DS1337 class (and header), no sample sketch that uses the class; I had to eliminate some alarm-related stuff, define some macros etc. In the end, I have a simplified version working;
- to upload the sketch to the board, I used the 3V3 version of the FTDI breakout from sparkfun (the 5V has the signal voltages too high).
- put the microcontroller to sleep when time is not read (this will reduce the consumption to micro amps, hopefully);
- implement the alarm functionality, with interrupts.
Conclusion DS1307 vs DS1337:
- DS1337 should be used in a 3V3 environment; it is not meant to be mixed with 5V signals;
- DS1337 libraries I looked at so far are pretty finicky compared to DS1307 libraries;
- an equivalent of (that is, as easy to use as) DS1307 for 3V3 is DS1340 (used by JeeLabs in their JeeNode boards).