Hello!! I just interfaced DS1307 with PIC18F8722, simulation in proteus is working fine but the problem is that it is not working in hardware.
I write time 17 hour 0 Min 09 sec and 26 Dec 2012 in rtc and its working fine and then read the time and date and displayed it on lcd, this working fine and just displaying this value with out incrementing
i changed the crystal 32.768Khz (though it might be not working properly) it works and then again fails to work
One strange thing when measuring volateg on oscillaor pin.
My Multimeter is in voltage mode and -ve probe is connected to ground and +ve probe is connected to oscillator first pin.
The Clock start running and by removing the probe it stops :-(
I am not able to know what is the problem, why it is not working.
No i have not connected battery..
But connected theVbat pin to ground
i used 10k to pull the lines scl and sda
used capacitor of 32.768khz with 10pf capacitors connected to it and then other terminals are ofcapacitors grounded.
The strnge things is that timing and date are reading and written properly.
The timr is not incrementing dont know why?
i thought it was due to crystal
i changed crystal and after that it works fot few secs and then stop working
then i was measuring voltage using fluke multimeter as soon as i.connected the probe to oscillstor pin num 1
it starts working and as i remove the probe it stops.
hat may be the problem. connect the battery backup or just disconnect it from ground. check for the incrementation. if you wrote a control word for a sqr_wave output can also check from the CRO.
Using a standard oscilloscope probe to measure the output directly from a crystal can often stop or drastically alter the frequency of oscillation due to the capacitive loading from the probe.
Typically an active probe with a low capacitance loading is used in such situations.
The overheating of the DS1307 maybe an indication the device was damaged, subject to reverse polarity of either the battery or standard power connections or operated at a voltage outside its specification.
If you are setting the time and date properly and it is not incrementing as expected, have you ensured the Clock Halt (CH) bit is properly cleared to start the clock.
Upon powerup the CH bit, bit 7 of Register 0, is set effectively halting the clock, it must be manually clear to successfully start the clock incrementation.
Bit 7 of Register 0 is the clock halt (CH) bit. When this bit is set to 1, the oscillator is disabled. When cleared to 0, the oscillator is enabled. On first application of power to the device the time and date registers are typically reset to 01/01/00 01 00:00:00 (MM/DD/YY DOW HH:MM:SS). The CH bit in the seconds register will be set to a 1. The clock can be halted whenever the timekeeping functions are not required, which minimizes current (IBATDR).
Also the use of 10kΩ resistors as pullups on SDA and SCL maybe a bit on the high side, if the DS1307 is the only device attached to the I2C bus you might try resistors in the 4.7kΩ to 2.2kΩ range.