Beavis
- 21st February 2005, 23:20
anyone got a 24fc512 to work using i2c? ic2write and read? cant seem to get this to work with this code:
CONTROL = %10100000' CONTROL ADDRESS OF 24FS512
'************************************************* ***********
b1="0"
' FOR B0 = 0 TO 15
I2CWRITE SDA,SCL,control,%0001,$156
PAUSE 100 ' DELAY 10MS AFTER EACH WRITE
' NEXT B0
LOOP:
I2CREAD SDA,SCL,control,%0001,[B1]
LCDOUT $FE,$80, bin16 B1
LCDOUT $FE,$c0, dec B1
pause 2000
LCDOUT, $FE,$1 'CLEAR LCD
PAUSE 1500
GOTO LOOP
CONTROL = %10100000' CONTROL ADDRESS OF 24FS512
'************************************************* ***********
b1="0"
' FOR B0 = 0 TO 15
I2CWRITE SDA,SCL,control,%0001,$156
PAUSE 100 ' DELAY 10MS AFTER EACH WRITE
' NEXT B0
LOOP:
I2CREAD SDA,SCL,control,%0001,[B1]
LCDOUT $FE,$80, bin16 B1
LCDOUT $FE,$c0, dec B1
pause 2000
LCDOUT, $FE,$1 'CLEAR LCD
PAUSE 1500
GOTO LOOP