This is my working example of how to read date and time from a DS1307 using I2C.
Don't forget to wire your 2k2 pull-up resistors from both SDA and SCL lines to 3v3 power line.
Hope you find this code inspiring and solve your LCD issue.
http://datasheets.ma...n/ds/DS1307.pdf
using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace i2c_ds1307{ public class Program { public static void Main() { // Device address 1101000 = 0x68 // Bus speed = 100 kbps (standard mode) I2CDevice.Configuration ds1307_cfg = new I2CDevice.Configuration(0x68, 100); I2CDevice ds1307 = new I2CDevice(ds1307_cfg); byte[] address = { 0 }; // i2c_write set register pointer to 0 to read from first position in ds1307 memory map byte[] data = new byte[7]; // i2c_read buffer to receive 7 bytes I2CDevice.I2CTransaction[] ds1307_actions; ds1307_actions = new I2CDevice.I2CTransaction[] { I2CDevice.CreateWriteTransaction(address), I2CDevice.CreateReadTransaction(data) }; while (true) { int bytecount = ds1307.Execute(ds1307_actions, 10); byte[] extracted = new byte[15]; byte[] extract_info = { 0, 0x70, 4, // 0 SEC x 10 0, 0x0F, 0, // 1 SEC 1, 0x70, 4, // 2 MIN x 10 1, 0x0F, 0, // 3 MIN 2, 0x40, 6, // 4 12/24h 2, 0x20, 5, // 5 AM/PM 2, 0x30, 4, // 6 HOUR x 10 2, 0x0F, 0, // 7 HOUR 3, 0x07, 0, // 8 DAY 4, 0x30, 4, // 9 DATE x 10 4, 0x0F, 0, // 10 DATE 5, 0x01, 4, // 11 MONTH x 10 5, 0x0F, 0, // 12 MONTH 6, 0xF0, 4, // 13 YEAR x 10 6, 0x0F, 0, // 14 YEAR }; for (int i = 0; i < extracted.Length; i++) extracted[i] = (byte)((data[extract_info[i * 3]] & extract_info[i * 3 + 1]) >> extract_info[i * 3 + 2]); int[] composed = new int[6]; byte[] compose_info = { 13, 14, 11, 12, 9, 10, 6, 7, 2, 3, 0, 1 }; for (int i = 0; i < composed.Length; i++) composed[i] = (byte)(extracted[compose_info[i * 2]] * 10 + extracted[compose_info[i * 2 +1]]); DateTime time = new DateTime(2000+composed[0], composed[1], composed[2], composed[3], composed[4], composed[5]); Debug.Print(time.ToString()); Thread.Sleep(2000); } } }}