I have a RaspberryPi acting as a master for an Atmel ATTiny861A slave over i2c, continuously sending a command plus 3 bytes of data to light an RGB LED. This works perfectly but ONLY if the AVR programmer is attached (it shares the same pins I'm using for i2c) OR if my Saleae Logic analyzer is connected to SDA and SCL. If neither is connected, the Python code running on the RaspberryPi reports an "Input/output error" about every 50 to 100 commands and eventually the line will lock up; the slave holds SDA low and won't let go.
My question is, what is special about the programmer or the probes that are allowing this to work? What do I need to change to allow normal operation when they are not connected?
I don't know what conditions lead to the Python code giving the error (its hard to catch on the analyzer with the constant stream of data), but I'm assuming the slave simply doesn't respond with an ACK when it should.
Additional details; I am running about 5ft of ribbon cable from the RaspberryPi to the slave (it cannot be closer). The RPi i2c operates at 3.3V so there is a level shifter/repeater (http://www.ti.com/lit/ds/symlink/tca9509.pdf) that I connect to. The output side Vcc is 5V. Additionally on the output of the TCA9509, I have 5k pullup resistors on the SDA and SCL lines. The distance between the TCA9509 and the ATTiny861 is about 2 inches.
If its useful, this is the code running on the ATTiny861A:
It uses Donald Blake's USI TWI Slave driver code, modified to remove defines related to non-ATTiny861 devices.