PDA

View Full Version : MN1307 sample code problem



ngeronikolos
- 19th November 2008, 11:01
Hi to all the picbasic club,

I have a problem with the SAMPLE code of MN1307.
I use as the code 16f628 and lcd module.I have just made some changes for the pins of the lcd and the SDA/SCL of the sensor DS1307
BUT
the time is going up very very slow.I change the sensor,the cystal but I have the some problem.Every seconds is approximately 6sec

What is wrong???
The Vbat going to ground,I have pulp up resistors for theSDA/SCL...

Please advice
Nikos

Melanie
- 19th November 2008, 14:08
MN1307 just sits in a loop continuously reading the registers of the DS1307 chip (about four times a second) and displaying the results.

If time is going by very slowly, then it is nothing to do with SDA/SCL, LCD or VBat. Either you have a defective DS1307, or a bad 32kHz Xtal (most likely), or you have additional Capacitance on that xtal that shouldn't be there... however to slow it down that much, I wouldn't think any Capacitance would pull it that slow.

Rip apart a cheap Digital watch, steal the xtal, it should work with the DS1307. Even an xtal cut with the wrong Capacitance will work, though it keeps rubbish time (ie could be out by as much as 30 minutes in a year).

Acetronics2
- 19th November 2008, 17:18
Rip apart a cheap Digital watch, steal the xtal, it should work with the DS1307. Even an xtal cut with the wrong Capacitance will work, though it keeps rubbish time (ie could be out by as much as 30 minutes in a year).


Hi, Mel

I have a LOT of xtals from Watches and timers ( most unmarked, ... of course ) ... most work on 3.27 ... MHz and some are really "exotics" ...

Without any verifying possibilities it's a bit ... risky.

Alain

Melanie
- 19th November 2008, 18:17
3.27MHz... for a timekeeping source??? Surely you mean 32.768kHz... as long as it's a rock of that frequncy, the DS1307 will drive it... but accuracy will depend on how close it is to the 'ideal' 12.5pF that the DS1307 is designed for. But slowing down to 1/6th of normal speed is abnormal.

Ioannis
- 20th November 2008, 10:41
If there was a large capacitance I bet it would stop completely. Let's see some schematic along with the "sample" code.

Then we will be stopping guesses...

Ioannis

ngeronikolos
- 20th November 2008, 20:34
Finally I find where was the problem

The time was too slow beacause of the 5v power.It was the PICKIT2 which power my pcb (it has this function)...and when I use psu 5vdc all was ok.

Does enyone has any idea why this happend???


By the way thanks to all.
Nikos

mackrackit
- 20th November 2008, 20:41
Not enough amps from the PICKIT2??