Can't get Nano 33 IoT to Nano 33 IoT I2C to work?

UPDATE:
Aug 5, 2020

I am still having difficulty in trying to get the Nano 33 IoT to communicate using the I2C with another Nano 33 IoT. I have reloaded the IDE along with the SAMD Core for the Nano 33 IoT. I used an MPU6050 to see if I could communicate with it over I2C and was successfull for each of the Nano 33 IoT’s. They each were able to keep a connection and return raw data using the Wire library for over 45 minutes each.

I am powering from a laptop computer via USB. I measured voltage on 3.3V pin and have 3.289 volts

I also performed an additional test where I used two Nano’s (older model) to communicate using the I2C using the same setup. The only difference being the hardware and software. They worked well and were very stable even after reducing the delay() time in the example and also increasing the clock to 400000 (setClock(400000)).

My code I am using for the slave_sender and master_reader is from the example included with the Wire library. The specific problem I am experiencing is that data just stops receiveing at the master. When this occurs a reset of the Nano is needed. Reseting either the slave or master will resume activity (I would think reseting the master is what would be needed but reseting the slave seems to do the same thing). During data transfer some of the data is corrupted, displaying a space or reverse “?” or even an “!” at times.

I adjusted the code at the master and noticed that the data stops when the “wire.available()” is no longer available. Even when the code executes the next statement in the loop, “Wire.requestFrom(2, 6)”, no further data is available. The result is the connection just stops. To correct this problem I inserted “Wire.begin()” after the wire is no longer available. By doing this I have been able to keep the connection sending the "hello ". It is as if I pressed the reset buton and it started again.

I am wondering if it is something in the library - I am not that familiar with the library and find it difficult to follow.

I have attached my code and other references. Sketches are master and slave. Photo is setup. Capture is console output from master. Also included scope activity when data is being transferred normally and then I tried to capture point when Wire.available() was lost. Maybe someone could try to reproduce or offer an explanation for why it is behaving the way it does.

:confused:


I have been trying to get I2C communications between two Nano 33 IoT to work. I have a simple setup in which I have connected the Ground, SDA, and SCL.

At times I used both USB only power and at other times I have supplied 5V through a voltage regulator on the Vin pin. I have met similiar results for both power setups. My speed observed on a scope for SCL is 100KHz. Power measurements on the 3.3 volt pin are good.

The software I used is from the Arduino IDE Wire examples.i have used master_writer and slave_receiver. Also used master_reader and slave_sender.

After loading it will start receiving but is experiencing some noise in the reception (text and numbers jumbled). It stops after less than a minute, a few times it lasted over a minute.

The Nano 33 IoT includes pullup resistors (4700k). I added to both the SDA and SCL lines a 10k resistor making the effective resistance 1902 ohm. I pulled them onto the 3.3 volt line. My thought this may increase the current to 3.3/1902 = 1.7ma.

I’m running out of ideas to try. Thinking software library not compatible with Nano 33 IoT but not likely? I have never tried processor to processor communication on I2C before - only sensors on Nano, Mega, and Uno.

master_reader1.ino (975 Bytes)

slave_sender1.ino (757 Bytes)

Oddly enough I was able to get this working after I disconnected the scope connection. Worked stable, clear error free communications. No dropouts or lockups. Still not sure things are working correctly and continue to experiment with adding addional pull-up resistors.