I'm using a 28X-1 with the A.0 firmware, and version 5.1.1 of the programming editor. Reading from the chip works fine. Whenever I attempt to write to my 28X-1 chip, though, the data never seems to get written to the chip. I'm using the following code for the i2c slave chip:
hi2csetup i2cslave,%10100000
ptr = 0
@ptrinc = 1
@ptrinc = 2
@ptrinc = 3
main:
for b0 = 0 to 10
ptr = b0
sertxd(#@ptr)
next b0
sertxd("hi2clast: ",#hi2clast)
if hi2cflag = 0 then main
sertxd("i2c works"
hi2cflag = 0
goto main
The thing writing to it does the following:
1) writes out a start bit and the i2c address
a) wait for acknowledge
2) writes one address byte
a) wait for acknowledge
3) write one data byte
a) wait for acknowledge
4) stop bit
From looking on a scope:
After writing the i2c address, the chip successfully acknowledges by holding the 9th bit low, but after writing the address byte and data byte, the chip doesn't hold the 9th bits low. The data on the chip never changes.
Any thoughts? (The i2c master is an FPGA, but it works fine with normal 24LCXX chips)
hi2csetup i2cslave,%10100000
ptr = 0
@ptrinc = 1
@ptrinc = 2
@ptrinc = 3
main:
for b0 = 0 to 10
ptr = b0
sertxd(#@ptr)
next b0
sertxd("hi2clast: ",#hi2clast)
if hi2cflag = 0 then main
sertxd("i2c works"
hi2cflag = 0
goto main
The thing writing to it does the following:
1) writes out a start bit and the i2c address
a) wait for acknowledge
2) writes one address byte
a) wait for acknowledge
3) write one data byte
a) wait for acknowledge
4) stop bit
From looking on a scope:
After writing the i2c address, the chip successfully acknowledges by holding the 9th bit low, but after writing the address byte and data byte, the chip doesn't hold the 9th bits low. The data on the chip never changes.
Any thoughts? (The i2c master is an FPGA, but it works fine with normal 24LCXX chips)