Shop OBEX P1 Docs P2 Docs Learn Events
RTC DS3231 question on P1 — Parallax Forums

RTC DS3231 question on P1

LudisLudis Posts: 69
edited 2021-03-16 02:42 in Propeller 1

Hello friends,

I'm reading the time from the RTC DS3231 included in the P2 holiday pixel kit.

The RTC turns seconds and minutes over as expected at 59. For some reason my hours are not turning over until after 29. I am setting a 24 hour clock, so I would expect after 23 to turn over to 00. Instead the hour keeps increasing and then turns over after 29. Thought maybe I was mixing up the month, but checked my code and I am not.

The registers from the datasheet are listed below. I also included screen shots of going from 23:59 to 24:00. I write the initial time once. Then I read in a loop as the RTC counts. What am I missing? Thanks



Comments

  • LudisLudis Posts: 69
    edited 2021-03-16 02:46

    Nevermind.. I figured it out. lol I was setting the hour bit-6 opposite of what it should be.

    The bit-6 should be 1 (high) for 12 hour clock.
    The bit-6 should be 0 (low) for 24 hour clock. I was setting it 1 (high).

    Moving forward!


Sign In or Register to comment.