From: volker <df...@am...> - 2012-02-01 23:36:17
|
Hi, I've been trying to add a i2c real-time-clock to my overo fire - so far without success. The realtime clock is a DS1307 on this sparkfun board: http://www.sparkfun.com/products/99 I wired it to the TOBI board using a logic level converter (also sparkfun: http://www.sparkfun.com/products/8745) according to this schematic: http://www.jumpnowtek.com/docs/gumstix/i2c/generic_i2c_circuit.png I checked several times, all the voltages are correct and it is wired up correctly (I don't have a logic analyzer) I configured the kernel options (using 'bitbake -c menuconfig virtual/kernel') to include the relevant options for i2c bus and the DS1307 rtc. I tried once compiling DS1307 as a a module and once by compiling it into the monolithic part of the kernel - both without success. On bootup I can see that the i2c modules are loaded, but there is no message relating to the DS1307. I can do an insmod DS1307 but nothing much happens (no output to the system log file). There is no error message, the module is loaded but I don't seem to have a hardware clock. When I run 'i2detect -r' I can see that a device with the i2c address 0x68 is present - that's the correct address for the realtime clock.: root@overo-99:~# i2cdetect 3 Error: Can't use SMBus Quick Write command on this bus root@overo-99:~# i2cdetect -r 3 WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-3 using read byte commands. I will probe address range 0x03-0x77. Continue? [Y/n] 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- I tried writing a simple program that reads the first seven bytes at register 0 using ioctls. I don't get any error messages but I always get the same values (80 00 00 01 01 01 00). These seven bytes should contain the time and date so I don't think I should always be getting the same values. I can get the same information with root@overo-99:~# i2cdump 3 0x68 b WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-3, address 0x68, mode byte Continue? [Y/n] 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 80 00 00 01 01 01 00 03 60 5a 40 03 40 40 00 01 ?..???.?`Z@?@@.? 10: 04 22 01 00 27 90 6a 04 a5 91 4c 80 53 00 44 04 ?"?.'?j???L?S.D? (plus several more lines) I should add that the kernel version is 2.6.39 r102 I checked the i2c bus speed using the uboot loader's "i2c speed" command, which reports that it is 100kHz. This should be fine. Not really sure what to try next. There is some information on using the DS1307 on gumstix on the web but that is outdated. I might try to test the realtime clock module using an arduino, but need to purchase one first. Any suggestions would be greatly appreciated. Volker -- View this message in context: http://gumstix.8.n6.nabble.com/Problems-with-i2c-real-time-clock-DS1307-on-overo-fire-tp4357707p4357707.html Sent from the Gumstix mailing list archive at Nabble.com. |