Shop OBEX P1 Docs P2 Docs Learn Events
My DS1307 — Parallax Forums

My DS1307

RsadeikaRsadeika Posts: 3,837
edited 2008-10-11 23:17 in General Discussion
Sometime ago I purchased an ETT mini-10 RTC board, tried it out with JonnyMac's DS1307_v2008.sxb program, and it seems to work. Now I was trying to figure out the slave address for the unit, and I am lost. In the program there is a line, I2CSEND SDA, __PARAM1, ackNak, I believe the ackNak is the slave address, but nowhere in the program is it defined, it is just a variable. So do I assume that the slave address is 0? Also I believe the DS1307 can run at 100KHz or 400KHz, I guess I should assume that SX/B I2C command is setup for the slower speed of 100KHz? I guess next I will try to use the 56 bytes of RAM that is available on the chip, wonder what I can do with that?

Thanks

Ray

Comments

  • ZootZoot Posts: 2,227
    edited 2008-10-11 23:17
    The address is not in that line -- it's an excerpt from the subroutine for sending a byte out on the I2C bus. To address the chip, the address is sent, then the register to read/write. __PARAM1 (the byte to send) is loaded by the main program or higher level routine that calls that subroutine.

    ack/nak is read/sent by I2C devices and may or may not be parsed or relevant depending on your needs. In this case I wouldn't worry about it if you are using pre-constructed routines.

    Default speed for I2C in SX/B 1.51.03 is ~100khz.

    I encourage you to read up on the I2C spec.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
Sign In or Register to comment.