Discussion in "Electronics" started by    pravin_35    Jul 11, 2014.
Fri Jul 11 2014, 11:01 am
#1
hello everyone,

I bought a new DS1307 from the market including Crystal (32.76khz).

i connected ds1307 in bread board and given 5v when i tried to check the crystal frequency (Pin2) in Oscilloscope i couldn able to see 32.76khz i don know what's wrong with the circuit. i don think i made wrong circuit because its simple circuit have less connections

Anyone have faced this kind of problem with DS1307. need solution for this help me pls.....
Fri Jul 11 2014, 10:55 pm
#2
are you sure if crystal and DS1307 is connected properly? do you any other crystal to try out? who knows if crystal is faulty from factory itself?
 pravin_35 like this.
Mon Jul 14 2014, 04:42 pm
#3


are you sure if crystal and DS1307 is connected properly? do you any other crystal to try out? who knows if crystal is faulty from factory itself?

ajay_bhargav



Ajay i have 5 crystals with me none is working....

I have 1 doubt does it requires any software initialisation for start the crystal..????

i have tried in bread board with DS1307 and crystal... giving 5v fron Arduino DUE.
Mon Jul 14 2014, 11:24 pm
#4


i connected ds1307 in bread board and given 5v when i tried to check the crystal frequency (Pin2) in Oscilloscope i wasn't able to see 32.76khz

pravin_35



Can you access the registers of the 1307 ?
if so, set bits 0,1 and 4 in the CONTROL REGISTER
to enable clock output on pin 7 (with a 10k pullup).

You might as well post your diagram just in case there is an error.


[ Edited Tue Jul 15 2014, 01:15 am ]
 pravin_35 like this.
Tue Jul 15 2014, 12:42 pm
#5
[/quote1405359982]
Can you access the registers of the 1307 ?
if so, set bits 0,1 and 4 in the CONTROL REGISTER
to enable clock output on pin 7 (with a 10k pullup).
You might as well post your diagram just in case there is an error.
[/quote1405408278]

Below Circuit i have followed....
Tue Jul 15 2014, 03:46 pm
#6
Probably your clock is halted and oscillator is off. You need to turn on clock by setting Bit 7 of register 0 in DS1307. see if that works for you.
Thu Jul 17 2014, 11:02 am
#7


Probably your clock is halted and oscillator is off. You need to turn on clock by setting Bit 7 of register 0 in DS1307. see if that works for you.

ajay_bhargav



ajay i have tried with some sample code from RTClib.h. i can able to set the time and get the current time and date via Comport . but still oscillator 2 pin is 50hz frequency.. i don know its rtc working effectively or not??? how to make it to run 32.36kz... any configuration required??? in below code

[left]#include <Wire.h>

#include "RTClib.h"

RTC_DS1307 rtc;

void setup () {
  Serial.begin(57600);
#ifdef AVR
  Wire.begin();
#else
  Wire1.begin(); // Shield I2C pins connect to alt I2C bus on Arduino Due
#endif
  rtc.begin();

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }
}

void loop () {
    DateTime now = rtc.now();
    
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
    
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
    
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);
    
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
    
    Serial.println();
    delay(3000);[/left][left][/left]
}
Fri Jul 18 2014, 04:15 am
#8
Are you confusing pin 2 and pin 7 ?
Pins 1 and 2 are connected to the crystal and should be the same (32k).
Is the 50Hz signal a square wave or a sine wave ?
Fri Jul 18 2014, 10:02 am
#9


Are you confusing pin 2 and pin 7 ?
Pins 1 and 2 are connected to the crystal and should be the same (32k).
Is the 50Hz signal a square wave or a sine wave ?

ExperimenterUK



hi its 2 pin i have tried i am getting sine wave..... 50hz but still my rtc is working how come???


[ Edited Fri Jul 18 2014, 12:21 pm ]
Fri Jul 18 2014, 08:03 pm
#10
Does the DS1307 keep time ?
That is, if you set it to 12.00 and wait 10 minutes does it report 12.10 ?

If so, the problem must be with how you are using the oscilloscope.
Do you have a good earth connection ?
Do you get the right signals on other pins ?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Michailqfh
Fri Mar 29 2024, 01:53 am
Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm