So you are saying that I have to conver my decimal 23 to bcd 35 and write that 0x35 to hours register to set it to 23 hours. So after it is set and again read and transformed using bcd2dec I get my 23 back. Am I right?
Looks like the author had some problems to perform proper dec2bcd(), too. Or why he's using fixed numbers?Add the following routines:
DS1307 : Setting Time
But where is the code which sets the ds1307 to some time?
what is the reault of dec2bcd(99)? Is it 0x63 or 0x99?
I just browsed the rtc code in the said thread and found that the set-routine is using incorrect values as well. I remember that illegal values are not filtered by DS1307 and are given back as illegal values or even cause unexpected bevaviour. The correct decimal number sequence for 0..31 day values should be 0..9,16..25, 32..41,48,49This is what I am writin to the day register. These are decimal values.
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,22,23,24,25, 26,27,28,29,30,31,38,39,40,41,42,43
they represent 0 to 31 days. But it is giving errors in proteus clock window.
@ alexan
No, I am not writing A, B, C, D,.....
This is what I am writing to the day register. These are decimal values.
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,22,23,24,25, 26,27,28,29,30,31,38,39,40,41,42,43
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?