Hi there,
I run into trouble when using the arduino wire library for communication between an Arduino Uno (master) and an Arduino pro mini board (slave).
I transmit 28 bytes of data two each 500 ms. It runs good for a period of time, but after lets say 2-3 minutes the slave blocks.
I already tried with or without external pullup restistors (4.7 K) -> still slaves blocks after a few minutes
I already tried without Arduinos connected to PC -> still slaves blocks after a few minutes
I already tried to increase the buffer size in twi.h and wire.h to 64 bytes -> still slaves blocks after a few minutes.
Now I am running out of ideas...
Here is the master code executed each 500 ms in main loop:
Wire.beginTransmission(4); // transmit to device #4
for (index = 0; index < 28; index++)
Wire.write (dataPtr[index]);
Wire.endTransmission(); // stop transmitting
}
Here is the slave code executed in receiveEvent function:
while (Wire.available() > 0) {
c = Wire.read();
if (index < sizeof (Data_t)) {
dataPtr[index] = c;
recvCRC+=dataPtr[index];
index++;
}
}
When I restart the slave by pressing the reset button communication goes on...
I am running the arduino (master) on only 5.1 volt. But this seems not to be a problem for other functionality.
I am running SoftwareSerial on the slave also - can this interfere with the wire library?
What can be the problem? Please help ![]()
Thanks in advance...