DS1307: I2C Serial Interface; how to do it?
The code that I posted earlier works fine for a DS1307!
Charles Linquist
Eng,
Tell me how you are determining the power. Are you using sensors, or just extrapolation? How many pins are you using? Need more data. I don't mind helping (what help I can provide as I am new to this stuff). Give more data, and you might just get more results.
Travin
sorry to say it but, what are: SDA_PIN, SCL_PIN,ClockAddr,Offset ?
i know nothing about them.....
what are their settings? should i write them as they are? or replace them with other things?
Moreover, how to set the first date and time? you provided me with the way i read or write but how to set the initial time?
thank you in advance :-)
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!
I just wanted to let you know that there is pre-written code for this chip. Go here:
http://www.melabs.com/resources/samp...ted/MN1307.txt
This might help.
Travin
__________________________________________________ ____________Originally Posted by Travin77
I have already found it but i really do not know how to make it work for PIC16F876A! things might be different a bit...
Many people are telling me that i just to need to write 2 to 3 lines only to fix the actual time, after defining the ports used. And then, i'll be able to read from DS1307. so when i saw that program.... i was chocked because of so many many lines....i don't want the user to do anything with time, i do not want to put buttons.. i just want this IC to have internal real time clock working fine so that whenever i want i can take the difference between 2 time intervals in order to get seconds and then, / 3600 to ge tthe hours...
As you see, i just want an extremely simple thing but i am not able to do it...
this is why, i'll keep on asking if someone can help me to write those 7 to 8 lines as i think..
did you look at this thread
http://www.picbasic.co.uk/forum/showthread.php?t=190
Bookmarks