1

Hey I recently posted a problem I had with the I2C (slave) library TinyWireS. I could not use slave-addresses higher than 63 for whatever reason.

I now want to start a new thread in order to fix this issue:

You can find more information on my project in my last post here The code for master and slave and the circuit is still the same.

What I found out:

When the master tries to communicate a slave over a particular address, the slave calls the ISR function (file: usiTwiSlave.c line: 569). This function is even called if the master sends to a different slave, because it checks weather the address is correct or not.

BUT:

When I tell the master to connect to slave > 63 ISR is never executed. Unfortunately I did not found out where the ISR function is called. I searched through every file but I could not find any "parent" function.

I'm pretty sure I'm close to find the bug, but I don't have much C/C++ experience.

I hope you can help me!

Community
  • 1
  • 1
user3025417
  • 395
  • 1
  • 5
  • 17

1 Answers1

0

I don't know if you have fixed this problem, but from my analysis, I suspect that the issue is a little more complex than you suggest. I don't believe that it is certain that the problem is in the TinyWireS (although it is probably there) and my reason for saying this is that my slave code works fine with most masters, and it is only when I am running an ESP8266 as the master that I see the same problem as you describe. The ESP8266 works fine as master with non-ATTiny85 slaves on any address. Without an oscilloscope, I cannot be certain, but I think there is likely to be a timing issue with the i2c start and the first bit of the address when it is a 1 which means that the conditions for generating an interrupt from the USI are not met. Given how few people are reporting the problem on the ATTiny85 8MHz, I am not ruling out that the timing problem is with the Master side but I'm pretty sure that it is a subtle timing issue. I should also mention that very occasionally, I can get a request recognised on an ATTIny85 when it has a high address but it is rare and again indicates a timing problem. I hope this helps to build the picture for this problem, and if you have the ability to scope the i2c bus, I suspect that the problem will become apparent.