Try changing your TRIS registers.
It looks like you have them set to outputs both clk and data.
Not sure why you are using asm?
and you set trisc two time I think you wanted to set port D in the second statement
Try (without asm)
PORTC = 0 ; clear portc
TRISC =%0001000 ;set portc.4 to input all others outputs
PORTD = 0 ;clear port d
TRISD =%0010000 ;set portd.5 to input all others outputs
This matches your IC2READ statements , if you want to use other pins you need to change
the DATA and clock pin assignments
TEST:
I2CREAD PORTC.4,PORTC.3,%01000001,[X] 'DOESN'T WORK - ALWAYS RETURNS DEC 16
'I2CREAD PORTD.5,PORTD.6,%01000001,[X] 'WORKS
DEBUG BIN8 X,10,13
PAUSE 500
GOTO TEST
Regards
Bookmarks