Shop OBEX P1 Docs P2 Docs Learn Events
NX1000's DS1307 grief — Parallax Forums

NX1000's DS1307 grief

nick bernardnick bernard Posts: 329
edited 2004-11-19 17:12 in BASIC Stamp
HAIL ALL,
i have DS1307.BSP running on a bs2p on my nx 1000 board
i have it wired as:
pin 0 -> SDA
pin 1 -> SCL
pin 4 -> D0 - switch
pin 5 -> D1 - switch
pin 6 -> D2 - switch
pin 7 -> GND

the debug screen displays

DS1307 Demo
65:65:65


my scope sees
0v on pin1 of the ds1307
5v on pin2 of the ds1307
0v on pin1 of the ds1307
5v on pin5 of the ds1307
5v on pin6 of the ds1307
0v on pin7 of the ds1307
5v on pin8 of the ds1307

any help?

rox on
nick bernard

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2004-11-18 15:50
    Nick -

    If you're looking at the same program (DS1307.BSP) that I am, which was originally found on the High-TechGarage web site, you will note that the EEPROM "switch" needs to be reset for the first run of the program, and anytime thereafter when you want to have the program initialize the real time clock. This should help with that issue:
    http://www.gorobotics.net/articles/article.php?name=realtimeclock

    Note: It appears that High-TechGarage is no longer in business under that name.

    Regards,

    Bruce Bates
  • nick bernardnick bernard Posts: 329
    edited 2004-11-18 16:03
    HAIL BRUCE!

    thx for the input yo, i got the program from the parallax site though. supplied specifically for the nx1000 board. in any case your input seems applicable and i'll give it a shot.

    rox on
    nick bernard
  • nick bernardnick bernard Posts: 329
    edited 2004-11-18 16:35
    i've tested all the i2c devices on the nx1000 and none of them seem to work.... wo is me

    nick bernard
  • K de JongK de Jong Posts: 154
    edited 2004-11-19 00:26
    Hi Nick,

    Do you have pull up's (4k7) on SDA and SCL ??

    Klaus
  • nick bernardnick bernard Posts: 329
    edited 2004-11-19 14:24
    yes... the nx1000 has them on the protoboard.

    i dont pick up any activity after i simply put a pullup (47k) on pins 0&1, (sda scl)... i figured there would be some signal movement with the i2c commands.

    but even if the i2c interface is failing then why doesnt the sqw pin on the ds1307 oscillate?

    you can find the soucecode that i'm running on the parallax site
    www.parallax.com/detail.asp?product_id=28137

    thx
    nick bernard
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-11-19 17:12
    The sqw pin does not run until you enable it with a setting in register 7 of the DS1307. Also, sqw requires a pullup resistor.

    The demo program has lots of bells and whistles. When I am confronted by something that doesn't work, I like to strip it down to the bare essentials.

      {$STAMP BS2P}
      {$PBASIC 2.5}
       seconds var byte
    
        I2COUT 0, $D0, 0, [noparse][[/noparse]$00, $00, $00, $00, $19, $11, $04, $10]
             ' should start the clock running setting Nov 19, 2004 at midnight
             ' sqw enabled at 1 Hz byt the $10.
      DO
          I2CIN 0,$D1,0,[noparse][[/noparse]x]   ' read seconds
          DEBUG Hex2 seconds, TAB, BIN in2,CR
          PAUSE 250
      LOOP
    
    



    That program uses in2 to read the state of the sqw pin. To do that, pin 3 of the DS1307) has to be connected with a pullup resistor, say 10kohms, to Stamp p2. With that program you should see activity from your 'scope on p0, p1 and p2. The sqw pin should have a period of 1 second as seen on the DEBUG screen and on the 'scope. Yes? No?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.