We have a TMS320F28027 operating in slave mode. We are having a heck of a time getting the initial communications to work. Both my intern and I have messed with this thing for days.
The odd thing is, if you do some weird combo of resetting the code, things will just work beautifully after that - but unfortunately I broke my ability to do that now.
The problem occurs when the master tries to either send or receive for the first time after system reset. This slave will NACK the address byte, and something is then stretching the address low byte. In my mind the clock stretch can be ignored for the moment, because the NACK occurs before that, and there is no way anything on the bus can turn an ACK into a NACK (because NACK is high, not low). So I believe there is definitely a problem on this slave.
Also, in either case I have checked the FIFOs, etc, and there is always an empty receiver and a transmitter that has data ready to send. Our system uses a PIO as "ready" handshake, and I have stepped through the debugger to verify everything is on the up and up.
Here are some registers right before the master sends out the data (System clock is 60Mhz):
Right after the failed transmission, it appears they are unchanged.
I2caRegs = {...}
I2COAR = 0x0030
I2CIER = {...}
all = 0
bit = {...}
I2CSTR = {...}
all = 1040
bit = {...}
ARBL = 0
NACK = 0
ARDY = 0
RRDY = 0
XRDY = 1
SCD = 0
rsvd1 = 0
AD0 = 0
AAS = 0
XSMT = 1
RSFULL = 0
BB = 0
NACKSNT = 0
SDIR = 0
rsvd2 = 0
I2CCLKL = 0
I2CCLKH = 0
I2CCNT = 4
I2CDRR = 8
I2CSAR = 0x03FF
I2CDXR = 1
I2CMDR = {...}
all = 16416
bit = {...}
BC = 0
FDF = 0
STB = 0
IRS = 1
DLB = 0
RM = 0
XA = 0
TRX = 0
MST = 0
STP = 0
rsvd1 = 0
STT = 0
FREE = 1
NACKMOD = 0
I2CISRC = {...}
all = 0
bit = {...}
rsvd1 = 1
I2CPSC = {...}
all = 5
bit = {...}
rsvd2 = 0x0000790D@Data
[0] = 261
[1] = 5
[2] = 0
[3] = 0
[4] = 0
[5] = 0
[6] = 0
[7] = 0
[8] = 0
[9] = 0
[10] = 0
[11] = 0
[12] = 0
[13] = 0
[14] = 0
[15] = 0
[16] = 0
[17] = 0
[18] = 0
I2CFFTX = {...}
all = 24704
bit = {...}
TXFFIL = 0
TXFFIENA = 0
TXFFINTCLR = 0
TXFFINT = 1
TXFFST = 0
TXFFRST = 1
I2CFFEN = 1
rsvd1 = 0
I2CFFRX = {...}
all = 8320
bit = {...}
RXFFIL = 0
RXFFIENA = 0
RXFFINTCLR = 0
RXFFINT = 1
RXFFST = 0
RXFFRST = 1
rsvd1 = 0