I tried to convert the hour read from DS1307 to minute and the display on LCD is ABC:EF . With ABC is the minutes and EF is the second . The code is below but i think there are something wrong .
Code:
I2CREAD SDA,SCL,$D0,$00,[SECOND,MINUTE,HOUR] ' READ DS1307
TOTAL_MINUTE = HOUR*60 + MINUTE
LCDOUT $FE , $2 ' GO TO LINE1 LCD 16x2
LCDOUT DEC3 TOTAL_MINUTE , ":" ,HEX2 MINUTE ' MAYBE WRONG HERE
If i use HEX3 TOTAL_MINUTE , is will show with the character A,B,C... when minute over 9 . and if i use DEC3 , the TOTAL_MINUTE is little faster than computer clock .
anyone can help me to fix this ?
I'm so sorry for my English . That isn't my language .
Thanks !
Bookmarks