Hi Friends,
I´m trying to use the Phillips PCF 8583 in my project.
But, after some tests, I discovered a strange problem.
After 59 minutes and 59 seconds, instead of going to 01:00:00 the RTC goes to 81:00:00
And, when I decode the data to calculate the elapsed time in seconds, I got a completely wrong result.
I have never noticed that problem before because I had never used this RTC as a chronometer as I´m doing now.
I´m sending a small code I wrote to test the RTC.
The pin A0 of 8583 is grounded.
Have ever you seen this problem ?
Thank you
Sérgio Pinheiro
===================== Test Code ================
Define LCD_DREG PORTA
Define LCD_DBIT 0
Define LCD_RSREG PORTB
Define LCD_RSBIT 4
Define LCD_EREG PORTB
Define LCD_EBIT 5
SDA var PORTB.1 ' I2C data pin
SCL var PORTB.2 ' I2C clock pin
H var byte
M var Byte
S var Byte
Pause 500
I2CWrite SDA,SCL, %10100001,2,[0,0,0]
pause 100
LOOP:
I2CRead SDA, SCL, %10100001,2,[S,M,H]
pause 100
lcdout $FE, 2, Hex2(h),":",Hex2(M),":",Hex2(S)
goto LOOP
END
Bookmarks