marzan
Senior Member
Hello. I am trying to use a PCF8583 RTC in timer mode.
Here is the data sheet: http://www.nxp.com/documents/data_sheet/PCF8583.pdf
I can`t seem to get the appropriate 90 second output ( in hundredths of a second)
Here is the code I am using. It is just a test program to see if i can get the output into variables
any suggestions are appreciated.
Marz
Here is the data sheet: http://www.nxp.com/documents/data_sheet/PCF8583.pdf
I can`t seem to get the appropriate 90 second output ( in hundredths of a second)
Here is the code I am using. It is just a test program to see if i can get the output into variables
Code:
symbol slvAddrWR = $A0 ' I2C write address
symbol slvAddrRD = $A1 ' I2C read address
MAIN:
PAUSE 1000
i2cslave slvAddrWR, i2cslow, i2cbyte 'Initialize I2C-7SEG
writei2c 8,(%00000001) ; alarm control registers and clock mode (08h)
pause 10
;bit7 enable alarm interrupt
;bit6 timer alarm
;bit5/4 clock alarm 00= no clock alarm
;bit3 timer interrupt enable
;bit2/1/0 timer function 001= hundredths of a second
writei2c 0,(%00000100) ;timer function to 99 seconds
;to enable %xx0xx1xx
do
readi2c 1, (b1,b2,b3,b4,b5,b6,b7,b8,b9)
pause 460
debug
loop
Marz