Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 troubles — Parallax Forums

DS1302 troubles

jmspaggijmspaggi Posts: 629
edited 2008-08-25 16:34 in General Discussion
Hi,

I'm trying to use a DS1302, but I have some troubles. I always receive wrong results from the getTime methode.

01:41:01
00:100:01
01:41:03
00:100:00
01:41:01
00:100:00
01:41:01
00:100:00
01:41:41
00:100:00
01:41:01
00:100:41
01:41:43
00:100:04
01:41:09
00:100:00




Here is my code:

          DS1302 ds1302 = new DS1302 (CPU.pin9, CPU.pin8, CPU.pin10);
          ds1302.writeTime(21, 13, 00, 8, 24, 8, 7);
          ds1302.charge(false);
          for (int i = 0; i < 20; i++)
          {
                  CPU.delay(10000);
                  System.out.println(ds1302.readTime(false));
          }




I checked the GND and Vcc (+4.94V), and that's correct. The occilator is close to the DS1302, and I also checked at least 10 times the PINs (clck, IO, Enable).

But it's still not working. So I think I'm doing something wrong somewhere, but I'm not able to figure what. Do you have any clue what my issue can be?

Also, I "played" with SETTLE_TIME without success.

Thanks for your help,

Jean-Marc

Comments

  • jmspaggijmspaggi Posts: 629
    edited 2008-08-25 16:34
    Hi,

    Adding a 2.2k resistor to between the DS1302 data pin and the Javalin data pin has solved the issue. Don't know why. But know it's working.

    Regards,

    JM
Sign In or Register to comment.