I have wired a PCF8563 to my 28x1 and as a test, I am using the following code:
'Clock Reader/Displayer
hi2csetup i2cmaster, %10100010, i2cslow, i2cbyte
writetime:
hi2cout 2, ($01)
debug
pause 1000
readtime:
hi2cin 2, (b0)
debug
pause 1000
goto readtime
all I wanted to do as a test, is write the seconds as 1 in the RTC, and then view those seconds incrementing as a test to see if the bus is okay.
viewing the sdl and sca lines on my ancient scope is difficult (read, nearly impossible to actually view as it has no "hold" feature) but things seem to be "okay".
is there any way see what's actually going on?
the chip supports i2cfast but I used slow just in case.
the confusion arises by the fact that a 255 is returned, which according to the picaxe BASIC manual is a hardware problem or the wrong i2cslave address is used. the hardware is fine (4.7k pullups, big ground plane, less than 1cm trace length on the data lines) and the slave address was pulled RIGHT out of the datasheet (the datasheet can be found at http://www.nxp.com/acrobat_download/datasheets/PCF8563_5.pdf). It mentions a "word address" but after further reading I have come to understand that the word address is actually just the "location" byte tacked on to the slave address, hence the "2" in the hi2cin/out command.
I'm completely lost, and haven't a clue what's wrong.
I'd also like to put in my two cents about this forum: the archiving completely screws up formatting making any code written nearly unreadable, and the search section is abominably buggy. However I do commend you all for your wisdom and experience, regardless of the forum software/administration options
'Clock Reader/Displayer
hi2csetup i2cmaster, %10100010, i2cslow, i2cbyte
writetime:
hi2cout 2, ($01)
debug
pause 1000
readtime:
hi2cin 2, (b0)
debug
pause 1000
goto readtime
all I wanted to do as a test, is write the seconds as 1 in the RTC, and then view those seconds incrementing as a test to see if the bus is okay.
viewing the sdl and sca lines on my ancient scope is difficult (read, nearly impossible to actually view as it has no "hold" feature) but things seem to be "okay".
is there any way see what's actually going on?
the chip supports i2cfast but I used slow just in case.
the confusion arises by the fact that a 255 is returned, which according to the picaxe BASIC manual is a hardware problem or the wrong i2cslave address is used. the hardware is fine (4.7k pullups, big ground plane, less than 1cm trace length on the data lines) and the slave address was pulled RIGHT out of the datasheet (the datasheet can be found at http://www.nxp.com/acrobat_download/datasheets/PCF8563_5.pdf). It mentions a "word address" but after further reading I have come to understand that the word address is actually just the "location" byte tacked on to the slave address, hence the "2" in the hi2cin/out command.
I'm completely lost, and haven't a clue what's wrong.
I'd also like to put in my two cents about this forum: the archiving completely screws up formatting making any code written nearly unreadable, and the search section is abominably buggy. However I do commend you all for your wisdom and experience, regardless of the forum software/administration options