Interface of DS1307 with PIC16F876A


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Eng4444's Avatar
    Eng4444 Guest

    Exclamation Interface of DS1307 with PIC16F876A

    Hello everybody,

    Is anyone ready to teach me how to program DS1307 to be used with PIC16F876 while programming with PicBasic Pro?

    i have never used I2C...

    I'm working working on electric energy calculation: Energy = Power . Time

    so i need to get the time and multiply it by the power i already calculated.Ne need to see time on LCD but just to manipulate with it internally.

    I am even ready to pay for the one who will give a whole program... in fact, i am so squeezed by time and i need a quick solution.

    Thank you.

  2. #2
    Eng4444's Avatar
    Eng4444 Guest


    Did you find this post helpful? Yes | No

    Default Not help yet

    Come one please... i need even small clues!

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Like ONE HOUR has elapsed since your initial post and you're bugging people for an answer... on a SUNDAY when almost all the professionals are home lazing by the pool and very few folks are actually looking at the forum.

    Code:
    	I2CAddress var Byte
    	RTCRegister var Byte
    	RegisterContents var Byte
    
    	I2CAddress=$D0
    	I2CRead SDA,SCL,I2CAddress,RTCRegister,[RegisterContents],I2CError
    Look in the PBP manual to see what I've written. Look in the RTC's Datasheet to discover what the Registers are and what they contain. Go to the MELabs website, download and study an RTC example that's posted there...

  4. #4
    Eng4444's Avatar
    Eng4444 Guest


    Did you find this post helpful? Yes | No

    Arrow Dear Melanie,

    You cannot understand what people have... please don't think that i am just sitting here waiting to study that stuff. I am a biomedical Engineer - from where my nickname- and i will graduate in 2 weeks.

    the last time i asked a help about "div32", i felt i was treated in a bad way.

    i want you to understand that working with PIC is not my specialization at all; not with PicBasic Pro, nor with DS1307.

    i just design medical instruments and machines and train doctors to use them.

    But it just happened that in my senior project, i am adding an extra part and using PIC. Then, i will never see PIC in my whole life.

    So in case you are able to help me, do it completely please; even if you ask for money.

    But i need a whole program... between DS1307 and PIC16F876A.

    By the way, can i use a program written in C and write it in the PicBasic Pro program? because i just found an interface written in C language.

  5. #5
    Eng4444's Avatar
    Eng4444 Guest


    Did you find this post helpful? Yes | No

    Default One more thing..

    i think you didn't understand me well because you provided me a program to read from DS1307 and i am thankful.

    But still, i dunno how to prgram it ( i mean how to set hours, minutes, seconds, month, day ,year for the first time).

    So as i said, i just bought a DS1307 and i have a PIC16F876A. what are the next steps?....


    I'll appear an idiot i know but really... this is not my field at all.. i got stuck with it and not way to step back because of lack of time...

    thank you all for your understanding.

  6. #6
    Eng4444's Avatar
    Eng4444 Guest


    Did you find this post helpful? Yes | No

    Lightbulb Melanie

    Would you be able to help me?

  7. #7
    Eng4444's Avatar
    Eng4444 Guest


    Did you find this post helpful? Yes | No

    Default Ds1307

    DS1307: I2C Serial Interface; how to do it?

  8. #8
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    The code that I posted earlier works fine for a DS1307!
    Charles Linquist

  9. #9
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default More specific

    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

  10. #10
    Eng4444's Avatar
    Eng4444 Guest


    Did you find this post helpful? Yes | No

    Default Dear Charles

    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 :-)

  11. #11
    Eng4444's Avatar
    Eng4444 Guest


    Did you find this post helpful? Yes | No

    Default Dear Travin77

    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!

  12. #12
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Did you look here?

    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

Similar Threads

  1. LCDOUT w/custom interface?
    By Mike, K8LH in forum PBP Extensions
    Replies: 4
    Last Post: - 3rd March 2015, 03:54
  2. Replies: 33
    Last Post: - 19th March 2010, 03:02
  3. DS1307 on fire
    By brid0030 in forum General
    Replies: 6
    Last Post: - 25th November 2006, 02:44
  4. 'SCI' interface
    By ecua64 in forum Off Topic
    Replies: 0
    Last Post: - 29th September 2005, 16:02
  5. User Configuration Interface in PBP
    By Radiance in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 08:00

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts