Let's say i will use port RC0 from my PIC16F876A.

i am getting power by using sensors. Things are so fine and i am being able to calculate this power. I am even seeing it on LCD. but now i need to go and get the energer... E = POWER . TIME

SO i still need the time... any detailed code suitable with PIC16F876A would be appreciated!

i need to know how to set the ports, how to enter the first date and time, if i need to write something related to frequency or not, how to read time from DS1307 into a variable, how to display it on LCD.

Thank you in advance!