Loading ...
Sorry, an error occurred while loading the content.

6728Re: [nslu2-general] Re: RTC adress?

Expand Messages
  • Greg Holdren
    Sep 7 10:21 PM
      ----- Original Message -----
      From: "joakimmaartensson" <stampedehockey@...>
      To: <nslu2-general@yahoogroups.com>
      Sent: Friday, September 07, 2007 11:35 AM
      Subject: [nslu2-general] Re: RTC adress?


      > Greg: You wouldn't mind sharing your test application? Or is the
      > i2c-device address hard-coded, instead of passed as an argument?
      >

      I have a 2.5" 10gig drive on my nslu2.

      The i2c address is hardcoded in the program along with the offset of 0x30 to
      get to the data regesters of the clock. You can change these for the 1 wire
      i2c device when you get an environment set up for compiling (native or
      cross). I used the native compiler that I set up a few years ago.

      crosstool-native - 0.28-rc37-5 -
      crosstool-native-arch-bin - 0.28-rc37-5 -
      crosstool-native-arch-inc - 0.28-rc37-5 -
      crosstool-native-arch-lib - 0.28-rc37-5 -
      crosstool-native-bin - 0.28-rc37-5 -
      crosstool-native-inc - 0.28-rc37-5 -
      crosstool-native-lib - 0.28-rc37-5 -

      I just followed the wiki native compile instructions to get on my system
      with ipkg. I would recommend a small harddrive, it will speed up the
      development.

      I tared up my i2c directory and placed it here:
      http://pages.sbcglobal.net/greghol/nslu2/nslu2_i2c.tar

      Make the i2c device as mentioned in the previous email and try the clock and
      i2ctest program. (I think it is staticly linked so it should run??) Clock
      just dumps the time and date in raw format. i2ctest writes 0 to the seconds
      reg and then dumps it like the clock program. (ignore the write values
      displayed, its just debug showing that it is putting the rtc in write mode)

      make will compile the clock prog from clock.c and makei2ctest will compile
      the i2ctest using i2clib.c.

      In any case you can just change the i2c address (addr) and then the internal
      register (reg)to what you want to read and/or write to the regs of the 1wire
      device. Read your datasheet good. I had problems in wrting to the clock. I
      guess I glazed over the part where I needed to write a 0x02 and then a 0x06
      to the base reg first. I had the logic analyzer out debugging it for a few
      nights.
      Re-read the datasheet and bingo it worked. :)

      Greg
    • Show all 9 messages in this topic