I replaced the DS1307 with VS1307 which seems to work.
Is there any other way to convert the data to dec other than:
I2CRead SDA, SCL, $D0, $00, [A]
Sec1=(A.0*1)+(A.1*2)+(A.2*4)+(A.3*8)
Sec10=(A.4*1)+(A.5*2)+(A.6*4)
I replaced the DS1307 with VS1307 which seems to work.
Is there any other way to convert the data to dec other than:
I2CRead SDA, SCL, $D0, $00, [A]
Sec1=(A.0*1)+(A.1*2)+(A.2*4)+(A.3*8)
Sec10=(A.4*1)+(A.5*2)+(A.6*4)
Last edited by menta; - 5th July 2008 at 09:21.
Now I need to understand how to convert from decimal (which comes from the user setup) to write to the RTC chip.
Last edited by menta; - 5th July 2008 at 22:11.
Found it
ConvertBCD:
CounterB=CounterA DIG 1
CounterB=CounterB<<4
CounterB=CounterB+CounterA DIG 0
Return
We're talking about a DS1307 RTC here (and ignoring the MSB of certain Registers) where the only valid individual digits are in the range 0-9. The subroutine converts two digit DECIMAL in the range 0-99 to a single BCD Byte. $EC is not a valid conversion requirement for this application.
Hi!!!
I just wan't to know if its possible how i can set manualy the initial time of the clock using a bic basic code!i tried to do it but i found some problems due to bcd and hex code!
so there someone that do it?!?!
thank you so much
bye bye Cris
Bookmarks