SparkFun Forums 

Where electronics enthusiasts find answers.

Hardware or product specific questions are best asked here.
User avatar
By DizietAsahi
#247608
Hi,
For the life of me, I cannot get two Artemis RedBoard to talk to each other over I2C and I don't understand why.

I have stripped everything from the boards the only connections I have are (top right of the board, near the USBC connector)

Controller Target
-------------- ---------
SCL <------------------> SCL
SDA <------------------> SDA
GND <------------------> GND

I uploaded the code from [the Arduino doc](https://docs.arduino.cc/learn/communication/wire/)

Controller:
Code: Select all
// Wire Controller Reader
// by Nicholas Zambetti [http://www.zambetti.com](http://www.zambetti.com)

// Demonstrates use of the Wire library
// Reads data from an I2C/TWI peripheral device
// Refer to the "Wire Peripheral Sender" example for use with this

// Created 29 March 2006

// This example code is in the public domain.


#include <Wire.h>

void setup() {
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
}

void loop() {
  Wire.requestFrom(8, 6);    // request 6 bytes from peripheral device #8

  while (Wire.available()) { // peripheral may send less than requested
    char c = Wire.read(); // receive a byte as character
    Serial.print(c);         // print the character
  }

  delay(500);
}
Target:
Code: Select all
// Wire Peripheral Sender
// by Nicholas Zambetti [http://www.zambetti.com](http://www.zambetti.com)

// Demonstrates use of the Wire library
// Sends data as an I2C/TWI peripheral device
// Refer to the "Wire Master Reader" example for use with this

// Created 29 March 2006

// This example code is in the public domain.


#include <Wire.h>

void setup() {
  Wire.begin(8);                // join i2c bus with address #8
  Wire.onRequest(requestEvent); // register event
}

void loop() {
  delay(100);
}

// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
  Wire.write("hello "); // respond with message of 6 bytes
  // as expected by master
}

I am not seeing anything on the serial terminal. These are the signals that I see on the I2C bus (blue is SCL, yellow is SDA):
PXL_20240301_190641384.jpg
I have tested the exact same code between two esp32 and everything works as expected.
PXL_20240301_191019386.jpg

I don't understand what I am doing wrong.
You do not have the required permissions to view the files attached to this post.
By paulvha
#247625
The Sparkfun Artemis Wire library does NOT support slave(peripheral) mode. It can only act as a Master (controller).
It is half-documented in the README on https://github.com/sparkfun/Arduino_Apollo3, but it is 100% sure as there is NO code to handle it.

You can connect an ESP32 as a peripheral to an Artemis running as a controller.
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum