Enabling SQWE @ 1Hz in DS1307

Discussion in 'Programmer's Corner' started by R!f@@, Mar 30, 2015.

  1. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    First off two files attached. The RTC data plus the test code in MikroC pro 7. Just rename it to .C (have to upload it as .txt...forum should support that guys)

    The code works as it should changed it a bit to suit me. It was from the mikro forum.

    What I was trying to do was for the past two hours is to get the SQWE 1 hz output. I am blanked. Trying to get my head around how it is in....been searching the net but I had no luck to get that going.

    So I am asking if any body please tell me what should be added and where to get the 1Hz output from the DS1307. I am using a DS1307 click board.
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    You need to also hit up the control register inside the DS when you initialize the time, see sheet 9. Add this just after you set the year (I2C1_Wr(c_year); ), sending a setting of 0x10 should give you the 1Hz output.

    Do note the output is open drain so you need a pull up resistor to see anything happen.

    And thanks for linking to the data sheet!
    R!f@@ likes this.