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.
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
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.
http://melabs.com/resources/samples/...ted/mn1307.txtPICBASIC 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
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks