Hello there....

a newbie in picbasic... and i cant start the ds1307....i can read it and i know that..when i discnnet battery it turn to 01/01/01 kiriaki (sunday)
here is my code...

my xtal is 32768 , 3v battery Li , 0,1μF cap in power, and 4,7k registors in data/clock pins.....

please help....thank you (sorry my English is no good)



dEFINE LOADER_USED 1 'Bootloader Used
define osc 4
define lcd_dreg portd 'LCD define
define lcd_dbit 4
define lcd_rsreg portd
define lcd_rsbit 3
define lcd_ereg portd
define lcd_ebit 2
define lcd_bits 4
define lcd_lines 2


pause 1000

SDA Var PORTB.0
SCL Var PORTB.1

RTCYear Var Byte
RTCMonth Var Byte
RTCDate Var Byte
RTCDay Var Byte
RTCHour Var Byte
RTCMin Var Byte
RTCSec Var Byte
RTCCtrl Var Byte


TRISB= %11111111


RTCYear = $11
RTCMonth = $12
RTCDate = $26
RTCDay = $02
RTCHour = $10
RTCMin = $33
RTCSec = $10
RTCCtrl = $10

settime:

I2CWrite portb.0, portb.1, $D0, $00, [RTCSec, RTCMin, RTCHour, RTCDay, RTCDate, RTCMonth, RTCYear, RTCCtrl]
pause 15


gettime:
I2CRead portb.0, portb.1, $D0, $00, [RTCSec, RTCMin, RTCHour, RTCDay, RTCDate, RTCMonth, RTCYear, RTCCtrl]
pause 10
TOGGLE portc.7

if rtcday=1 then Lcdout $fe, 1, hex2 RTCMonth, "/", hex2 RTCDate, "/" , hex2 RTCYear , " Kiriaki"
if rtcday=2 then Lcdout $fe, 1, hex2 RTCMonth, "/", hex2 RTCDate, "/" , hex2 RTCYear , " Deutera"
if rtcday=3 then Lcdout $fe, 1, hex2 RTCMonth, "/", hex2 RTCDate, "/" , hex2 RTCYear , " Triti"
if rtcday=4 then Lcdout $fe, 1, hex2 RTCMonth, "/", hex2 RTCDate, "/" , hex2 RTCYear , " Tetarti"
if rtcday=5 then Lcdout $fe, 1, hex2 RTCMonth, "/", hex2 RTCDate, "/" , hex2 RTCYear , " Pempti"
if rtcday=6 then Lcdout $fe, 1, hex2 RTCMonth, "/", hex2 RTCDate, "/" , hex2 RTCYear , " Paraskeui"
if rtcday=7 then Lcdout $fe, 1, hex2 RTCMonth, "/", hex2 RTCDate, "/" , hex2 RTCYear , " Savvato"
Lcdout $fe,$c0, hex2 RTCHour, ":", hex2 RTCMin, ":", hex2 RTCSec

pause 490

goto gettime