May be Your write Routine, test this:

WriteX
FOR ADDRESS=0 TO 20
I2CWRITE DPIN,CPIN,CONTROL,ADDRESS,VALUE[ADDRESS]
PAUSE 10
NEXT ADDRESS