Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

RoBoard 110 and Arduino I2C

Based on DMP's Vortex processor / SoC this board is a full computer capable of running a standard Windows and Linux installation on the backpack of your robot.
2 postsPage 1 of 1
2 postsPage 1 of 1

RoBoard 110 and Arduino I2C

Post by hellu » Sat Mar 19, 2011 6:29 pm

Post by hellu
Sat Mar 19, 2011 6:29 pm

Hello!
I am trying to send some data on I2C to an Arduino Uno board but it`s not working at all. The Arduino doesn`t receive nothing. I`m programming in C#, below is my code on the RoBoard with the I2C. Is 0x30 a valid address for a slave device? The RoBoard is master and Arduino slave.
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RoBoIO_DotNet;
namespace I2C
{

class Program
{

static void Main(string[] args)
{

RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
if (RoBoIO.i2c_Initialize(RoBoIO.I2CIRQ_DISABLE) == false)
{

Console.WriteLine(RoBoIO.roboio_GetErrMsg());
}

else
{

RoBoIO.i2c0_SetSpeed(RoBoIO.I2CMODE_AUTO, 1100);
RoBoIO.i2c0master_StartN(0x30, RoBoIO.I2C_WRITE, 1);
RoBoIO.i2c0master_WriteN(0x11);
RoBoIO.i2c_Close();
}

}

}

}
Hello!
I am trying to send some data on I2C to an Arduino Uno board but it`s not working at all. The Arduino doesn`t receive nothing. I`m programming in C#, below is my code on the RoBoard with the I2C. Is 0x30 a valid address for a slave device? The RoBoard is master and Arduino slave.
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RoBoIO_DotNet;
namespace I2C
{

class Program
{

static void Main(string[] args)
{

RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
if (RoBoIO.i2c_Initialize(RoBoIO.I2CIRQ_DISABLE) == false)
{

Console.WriteLine(RoBoIO.roboio_GetErrMsg());
}

else
{

RoBoIO.i2c0_SetSpeed(RoBoIO.I2CMODE_AUTO, 1100);
RoBoIO.i2c0master_StartN(0x30, RoBoIO.I2C_WRITE, 1);
RoBoIO.i2c0master_WriteN(0x11);
RoBoIO.i2c_Close();
}

}

}

}
hellu
Robot Builder
Robot Builder
Posts: 18
Joined: Thu Jan 06, 2011 5:34 pm

Re: RoBoard 110 and Arduino I2C

Post by josh » Mon Mar 21, 2011 2:36 am

Post by josh
Mon Mar 21, 2011 2:36 am

hellu wrote:Is 0x30 a valid address for a slave device?


If slave device is 7-bit adrress, set RoBoIO.i2c0master_StartN(0x30, RoBoIO.I2C_WRITE, 1).

If slave device is 8-bit adrress, set RoBoIO.i2c0master_StartN(0x30>>1, RoBoIO.I2C_WRITE, 1).

Because the function RoBoIO.i2c0master_StartN sends (7-bit address) + (write/read bit), the slave device recieve (address << 1) + (0/1) in fact.
hellu wrote:Is 0x30 a valid address for a slave device?


If slave device is 7-bit adrress, set RoBoIO.i2c0master_StartN(0x30, RoBoIO.I2C_WRITE, 1).

If slave device is 8-bit adrress, set RoBoIO.i2c0master_StartN(0x30>>1, RoBoIO.I2C_WRITE, 1).

Because the function RoBoIO.i2c0master_StartN sends (7-bit address) + (write/read bit), the slave device recieve (address << 1) + (0/1) in fact.
josh
Robot Builder
Robot Builder
Posts: 21
Joined: Wed Apr 07, 2010 1:43 am


2 postsPage 1 of 1
2 postsPage 1 of 1