Connections for Standard 32.768kHz Quartz Crystal. The internal oscillator circuitry is
designed for operation with a crystal having a specified load capacitance (CL) of 12.5pF.
X1 is the input to the oscillator and can optionally be connected to an external 32.768kHz oscillator.
The output of the internal oscillator, X2, is floated if an external oscillator is connected to X1.
X1 and X2 are the two pins where we connect a crystal.
1. If i connect 1 leg of crystal in X1 only & leave the other leg disconnected then will my RTC start to give accurate time.
2. X2 becomes floated so what happens if i ground it. As i remember we dont want to keep pins in floating state.
i am asking this because I am receiving some noise in my RTC most probable from the crystal side.
The RTC is connected with Atmega8 using I2C bus. I have grounded the crystal but still i get some noise and times to time it gets all wacky specially when my relays tick tack.
My grounding the crystal may not be that good i will check it again. Other that that if i disconnect he RTC my uC works smooth no matter how many time i turn on off the relays.
The RTC is connected with Atmega8 using I2C bus. I have grounded the crystal but still i get some noise and my times gets all wacky time to time specially when my relays tick tack.
//Initialize I2C Bus
I2CInit();
//Clear CH bit of RTC
DS1307Read(0x00,&temp2);
//When this bit is set to 1, the oscillator is disabled. When cleared to 0, the oscillator is enabled.
//Clear CH Bit to 0 to enable the rtc oscillator
temp2&=(~(1<<CH)); //turns the rtc on
DS1307Write(0x00,temp2);
//Set 24 Hour Mode
DS1307Read(0x02,&temp2);
temp2&=~(0b01000000); // set bit 6 to 0 for 24 hr mode
//Set 24Hour BIT
//Write Back to DS1307
DS1307Write(0x02,temp2);
this is the code for the I2C library i am using.
just a note---They are very reliable i have been using 3 chips in my different aquariums for over 1 year without any issue. although there is some time drifts due to temperature i guess.
thanks
I managed to activate the internal oscillator, but when I ordered the activation of
It will be zero, then the second!
I'm going to activate the internal oscillator zero bit ch.
It is true?
thanks
I managed to activate the internal oscillator, but when I ordered the activation of
It will be zero, then the second!
I'm going to activate the internal oscillator zero bit ch.
It is true?
i'm sorry !!
I am from Iran and i speak persian.
Sorry if I can not rightly tell you my wishes.
In fact, I want this piece to start the internal oscillator.
I have a problem.
Which basic are you using??? The oscillator is usually started when you update the seconds register!... Bit eight is the CH bit.. when this bit is clear / off / zero, the oscillator runs...
I am using BASCOM-AVR.
My problem is that enabling this bit causes the value of seconds is zero.
Therefore to enable the oscillator is forced to change the amount of seconds.
If the oscillator isn't running and you read the seconds register... Then write back the same value but changing the ch bit, you wont affect the seconds.... Similarly you could only drop half a second if the oscillator is running and you want to stop it...
When a DS1307 is first initialised, we send the time to it... Once this is done we then can read back the real time whenever we need... There is no need to stop / start the oscillator...
Set up a time array Sec, Min, Hour, Day, Date, Mon,Year..... And just write the whole array to and from the chip..
You will also need a binary ~ BCD routine and the BCD ~ binary routine as the DS1307 stores the information in BCD format!
What speed crystal do you have on pin 1 and 2... You need to use a 32khz one... you also need a 3v battery across pins 3 and 4... Have you a scope to check the crystal is running???
What speed crystal do you have on pin 1 and 2... You need to use a 32khz one... you also need a 3v battery across pins 3 and 4... Have you a scope to check the crystal is running???
I guess his problem is that the Second remains in ZERO, so he think that his oscillator is disabled.
I think he got it fixed after you told him to use a 32khz crystal and a battery.
Just wondering what happens if we connect a 1Mhz crystal to DS1307??will it fly ??