

If both devices run at nearly the same frequency, you'll get a beat pattern. If one device runs much faster than the other, it can compensate for the difference in frequencies by busy-waiting for as long as it takes to get the next signal. The internal oscillators in most microcontrollers are good at controlling internal timing, but aren't precision timepieces by any stretch of the imagination. The TinyWire library uses short delays between pulses to allow for synchronization between the sender and receiver. This is just a guess, but you could be seeing the effects of clock skew between two devices running at speeds that are nearly-but-not-quite equal.

Been spending several nights trying to figure this out. Is there something that I am missing, any comments as to what else to check would be greatly appreciated.

I have tried changing the F_CPU from 1000000ul to 8000000ul, tried playing with the T2_TWI, T4_TWI for the delays, tried different pull ups. I have looked through the TinyWireM.cpp/.h, and USI_TWI_Master.h/.cpp. When I switch back to 1Mhz, I get output on the serial monitor and it works, get data transmitting over i2c. It hangs, in fact no serial data is transmitted to the monitor (don't see anything). I have serial outputs of the status register for initialization, sending data to trouble shoot, but nothing outputs. Whenever I try to use an Attiny device at 8Mhz with the I2C library (TinyWireM), it never works. I have successfully got the following to work:Īrduino Uno (master) Attiny 84/85 (running 8mhz) : Communicating master to slave, and back to master - OKĪttiny 84/85 1 MHz) Master Attiny 84/85 8mhz): Communication between Attiny master to slave and back - OKĪttiny84/85 8 Mhz) Master Attiny 84/85 8 MHz): Does not work Was wondering if someone can help point me in the right direction with some issues I have been having with the TinyWireM library for the Attiny85/84 I2c communication.
