you said:

"
"What Jumper is referring to with the GOSUB is that the routines "Start_RTC" and "RTC_Read" are called from your main program. Read the PBP manual referring to the word "GOSUB" for a further explanation.

The clock setting portion is, as I stated in an earlier reply, is handled in the setup of the clock. You put these values in the variables for the clock, meaning "seconds", "minutes", "hours", etc then write them into the RTC. "
__________________________________________________ ______________

So do you mean that i should write all the program:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

TRIS? = %00000000 ' all pins to output just replace ? with port name

SDA var Port?.? 'define port for I2C communication replace ?.? with pin
SCL var Port?.?

Hours var Byte
Minutes var Byte
Seconds var Byte
RTC var Byte
I2C_Adr_B var byte


RTC = % 11010000 ' Device adress on I2C bus
I2C_Adr_B=0

I2CWRITE SDA,SCL,RTC,I2C_Adr_B,[128,0,0,0,0,0,0,128] 'Reset time to 0 and stopped, 12 hour setting

Start_RTC:
I2C_Adr_B=0
I2CWRITE SDA,SCL,RTC,I2C_Adr_B,[0,0,0,0,0,0,0,16] 'Start RTC if you put a resistor and LED between the "SEC" pin and 5V it should start flash 1/s
return

RTC_Read:
I2C_Adr_B=0
I2CREAD SDA,SCL,RTC,I2C_Adr_B,[seconds,minutes, hours] ' in bcd code

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

in the PIC16F876A directly and it works?

let's say i want to chose port B and pin 22 which is RB1
23 which is RB2
so i write:
TRISB = %00000000
SDA var PortB.1
SCL var PortB.2
true?
and i wire b.1 to sda of DS, B.2 to SCL DS.... right?



Now tell me, if i just connect PIC16F876A to this DS1307 and a 4 lines LCD (or 2 lines). and let's say i just want to use this whole PIC just for the DS (it's stupidity i know but let's say i will keep all ports not used) would this program, as he gave it to me, be enough to begin displaying time and date on LCD? or i should write more things that he didn't write thinking that i should know them..... ?