Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mo_bri
New Contributor I
875 Views

D2000 i2c

Hi,

I just want a to send very simple messages through i2c to a connected Arduino Uno from my D2000. I can get 3 Arduino Uno's taking really easily, I have 2 sending messages and the other one is waiting for an on receive event, then I simply read the messages from the other UNO's on the ic2 channel.

I nkow the D2000 will require level shifting (it's 3.3 volt and the Arduino Uno signal is 5 volt - I have a bi-directional converter, with the UNO SDA to the D2000 SDA and the UNO SCL to the D2000 SCL, also they are connected via common ground.

Here is a code sample

# include

void setup()

{

Wire.begin(9);

Wire.onReceive(receiveEvent); // register event

Serial.begin(9600); // start serial for output

Serial.print("Started version 1 on the UNO - waiting to get a message via i2c");

}

void loop()

{

delay(1000);

}

void receiveEvent(int howMany)

{

while (1 < Wire.available()) { // loop through all but the last

char c = Wire.read(); // receive byte as a character

Serial.print(c); // print the character

}

}

So you can see this Arduino waits for messages, gets a software call back and then reads the message from the wire.

Can anyone send me a sample of code that would send this Arduino a message from the D2000 ?

Here is a sample of how the Arudino sends a message via i2c to device address 9 ...

# include

void setup()

{

Wire.begin();

Serial.begin(9600);

}

void loop()

{

Serial.println("This is the 101 on wire port 9 - Just about to send to the UNO via i2c");

Wire.beginTransmission(9); //Send to wire address number 9

Wire.write("hello marcus !!"); // respond with message of 6 bytes

Wire.endTransmission();

delay(3000);

}

So I just want a way to send via i2c, and if possible how to receive from an Arduino would be cool too.

The example i2c for the d2000 is a real mess, far too hard to read, its for some kind of EEPROM chip !!????

Thanks.

Marcus

3 Replies
Pedro_M_Intel
Employee
59 Views

Hello marcuso,

If you would like to understand the way the D2000's API interacts with its I2C interface, I'd suggest you to check its documentation in C:\IntelSWTools\ISSM_2016.1.067\firmware\bsp\1.1\doc\html specifically in group_groupI2C.html and compare it to the example code found in https://github.com/quark-mcu/qmsi/blob/master/examples/i2c/main.c qmsi/main.c at master · quark-mcu/qmsi · GitHub . That way you would be able to learn how the functions are applied and how you should use them in your own project. I suggest you to check the documentation and if you continue to have doubts, please post them here.

We will take into account your feedback of the complexity of the I2C and pass it to the appropriate team.

-Peter.

mo_bri
New Contributor I
59 Views

Hi,

I see you have a new board out ,the Intel® Joule Module, any chance of a board to review for my web site ? I have a 101 and a D2000, both of which I will be reviewing once I get some of the features working on the D2000, so this would really balance things out, from the cheap 101 up to the powerful Joule, via the middle D2000

http://roboticsfordreamers.com/ www.roboticsfordreamers.com

Thanks

Marcus

Pedro_M_Intel
Employee
59 Views

That board was just announced yesterday, there's not much information available yet, so, I can't tell you if there will be sample units. Also, the Joule community ( ) was opened yesterday, so I'd suggest you to wait a couple of weeks and post your question there or if you would like a more immediate response you could submit an email to https://customercare.intel.com/?lang=en-US https://customercare.intel.com/?lang=en-US .

-Peter.

Reply