Please help with DS1307 realtime clock .


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Please help with DS1307 realtime clock .

    HI,

    There are several examples in the fórum to use this RTC, please use the search of the fórum.
    Meanwhile, DS1307 handles BCD Format, and not decimal format, for that reason you must convert first.
    Thanks and Regards;
    Gadelhas

  2. #2
    Join Date
    Feb 2011
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: Please help with DS1307 realtime clock .

    Get_Time: I2Cread datapin, clockpin, $d1, 0, [sec,minute,hour,day,date,month,year] if display then hserout [12] ' Clear screen if display then hserout [hex2 month," / ",hex2 date," / 20",hex2 year," ",hex hour,":",hex2 minute,":",hex2 sec] ' Hex decimal numbers for clock display, must be converted to decimal to be useful. second = (sec >> 4)*10 + (sec & $F) ' second = (sec.HIGHNIB*10+sec.LOWNIB) time = ((hour >> 4)*10 + (hour & $F))*60 + (minute >> 4)*10 + (minute & $F) ' Number of minutes since midnight.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Please help with DS1307 realtime clock .

    PICBASIC PRO demonstrator for the DS1307, PIC16F628, LCD and three buttons. It shows how you can use buttons to enter time, date and operating mode (12 or 24 hour clock) to preset the DS1307, and also shows how the date is verified for validity so you don't enter 29 February when you're not supposed to. It has autorepeat on the buttons and automatically returns you to time/date view if you're in setup and don't press any buttons within a set time period. Written by Melanie Newman
    http://melabs.com/resources/samples/...ted/mn1307.txt
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 2

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