I2C bus on RBC (ATMEGA128) for many sensor

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
24 postsPage 1 of 21, 2
24 postsPage 1 of 21, 2

I2C bus on RBC (ATMEGA128) for many sensor

Post by Flid » Fri Jul 23, 2010 12:43 pm

Post by Flid
Fri Jul 23, 2010 12:43 pm

The RBC (ATMEGA128) have one I2C bus at pin 25 (SCL/INT0) PD0 & 26 (SDA/INT1) PD1 :D and used for the eeprom (24LC256SN)

The I2C bus can address 20 items ( 19 Slaves and 1 Master, the RBC ), It's a good opportunities to add many sensors for our RoboBuilder 8)

Maybe somebody have make one hack in this direction and add many I2C
functionality on Robobuilder :wink:
The RBC (ATMEGA128) have one I2C bus at pin 25 (SCL/INT0) PD0 & 26 (SDA/INT1) PD1 :D and used for the eeprom (24LC256SN)

The I2C bus can address 20 items ( 19 Slaves and 1 Master, the RBC ), It's a good opportunities to add many sensors for our RoboBuilder 8)

Maybe somebody have make one hack in this direction and add many I2C
functionality on Robobuilder :wink:
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by i-Bot » Fri Jul 23, 2010 1:39 pm

Post by i-Bot
Fri Jul 23, 2010 1:39 pm

Robobuilder has two I2C interfaces, one in hardware with the EEPROM and one in software with the accelerometer connected.

I put connectors where the accelerometer was and connected a remote board with accelerometer and I2C camera from wiimote. This works fine.

Image
Robobuilder has two I2C interfaces, one in hardware with the EEPROM and one in software with the accelerometer connected.

I put connectors where the accelerometer was and connected a remote board with accelerometer and I2C camera from wiimote. This works fine.

Image
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Flid » Fri Jul 23, 2010 2:50 pm

Post by Flid
Fri Jul 23, 2010 2:50 pm

i-Bot wrote:Robobuilder has two I2C interfaces, one in hardware with the EEPROM and one in software with the accelerometer connected.

I put connectors where the accelerometer was and connected a remote board with accelerometer and I2C camera from wiimote. This works fine.

Image


How you read or write at the second I2C bus ?
i-Bot wrote:Robobuilder has two I2C interfaces, one in hardware with the EEPROM and one in software with the accelerometer connected.

I put connectors where the accelerometer was and connected a remote board with accelerometer and I2C camera from wiimote. This works fine.

Image


How you read or write at the second I2C bus ?
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by Flid » Fri Jul 23, 2010 3:18 pm

Post by Flid
Fri Jul 23, 2010 3:18 pm

No access in RobobuilderLib.dll :cry:

Maybe later in the next release :wink:
No access in RobobuilderLib.dll :cry:

Maybe later in the next release :wink:
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by l3v3rz » Fri Jul 23, 2010 4:56 pm

Post by l3v3rz
Fri Jul 23, 2010 4:56 pm

It would need functionality added to RBC firmware i.e. DCMP as well. It currently talks to accelerometer so its possible. The I2C code looks very time critical in places and very device specific - any idea what sort of an interface would be needed to talk to any device?

Alternatively why not connect devices to the wck bus - this is much easier to connect to and easier to talk to. Hamvid uses wck bus (it steal servo id 30), as does the sound chip, the only problem is making sure the devices don't clash when talking. The Cylon head mod I built does the same and I use a PIC chip to read data off the bus.
It would need functionality added to RBC firmware i.e. DCMP as well. It currently talks to accelerometer so its possible. The I2C code looks very time critical in places and very device specific - any idea what sort of an interface would be needed to talk to any device?

Alternatively why not connect devices to the wck bus - this is much easier to connect to and easier to talk to. Hamvid uses wck bus (it steal servo id 30), as does the sound chip, the only problem is making sure the devices don't clash when talking. The Cylon head mod I built does the same and I use a PIC chip to read data off the bus.
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by l3v3rz » Sun Jul 25, 2010 4:09 pm

Post by l3v3rz
Sun Jul 25, 2010 4:09 pm

Ive had a think :) and I have started coding this in, so it will be in the next version of DCMP and RobobuilderLib.

The .NET interface looks like this (added to wckMotion class)

public bool I2C_write(int addr, byte[] outbuf)
This will send all the bytes in outbuff to the slave 'addr'

public byte[] I2C_read(int addr, byte[] outbuf, int cnt)
This will send all the bytes in outbuf to the slave 'addr' and then
read 'cnt' bytes from the I2C bus.

So example will look like this to initialise the accelerometer:
Code: Select all
            wckMotion wmt = new wckMotion("COM5", true);

           // acc init
            if (!wmt.I2C_write(0x70, new byte[] { 0x14, 0x03 }))
            {
                Console.WriteLine("I2C test failed");
            }


Still testing the communication out - so should be available in a few days/next week

Edit:
here's an example of reading the accelerometer values
Code: Select all
   wmt.I2C_write(0x70, new byte[] {0x02});

   byte[] ib = wmt.I2C_read (0x71, new byte[] {}, 6);      
   Console.WriteLine("x={0}, y={1}, z={2}",
      wmt.cbyte(ib[1]) ,
      wmt.cbyte(ib[3]),
      wmt.cbyte(ib[5]));


cheers
Ive had a think :) and I have started coding this in, so it will be in the next version of DCMP and RobobuilderLib.

The .NET interface looks like this (added to wckMotion class)

public bool I2C_write(int addr, byte[] outbuf)
This will send all the bytes in outbuff to the slave 'addr'

public byte[] I2C_read(int addr, byte[] outbuf, int cnt)
This will send all the bytes in outbuf to the slave 'addr' and then
read 'cnt' bytes from the I2C bus.

So example will look like this to initialise the accelerometer:
Code: Select all
            wckMotion wmt = new wckMotion("COM5", true);

           // acc init
            if (!wmt.I2C_write(0x70, new byte[] { 0x14, 0x03 }))
            {
                Console.WriteLine("I2C test failed");
            }


Still testing the communication out - so should be available in a few days/next week

Edit:
here's an example of reading the accelerometer values
Code: Select all
   wmt.I2C_write(0x70, new byte[] {0x02});

   byte[] ib = wmt.I2C_read (0x71, new byte[] {}, 6);      
   Console.WriteLine("x={0}, y={1}, z={2}",
      wmt.cbyte(ib[1]) ,
      wmt.cbyte(ib[3]),
      wmt.cbyte(ib[5]));


cheers
Last edited by l3v3rz on Sun Jul 25, 2010 5:11 pm, edited 1 time in total.
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by i-Bot » Sun Jul 25, 2010 4:50 pm

Post by i-Bot
Sun Jul 25, 2010 4:50 pm

Looking good :D

There are a few examples here of devices we found useful on Robonova ( compass, speech,..) They may at least give you some idea of the variety.
http://robosavvy.com/Builders/i-Bot/I2CC.zip

Wireless nunchuck, might be fun !

My Robonova and robobuilder are a bit "Toy Story 3" at present, so I probably can't help very much.
Looking good :D

There are a few examples here of devices we found useful on Robonova ( compass, speech,..) They may at least give you some idea of the variety.
http://robosavvy.com/Builders/i-Bot/I2CC.zip

Wireless nunchuck, might be fun !

My Robonova and robobuilder are a bit "Toy Story 3" at present, so I probably can't help very much.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Flid » Sun Jul 25, 2010 6:36 pm

Post by Flid
Sun Jul 25, 2010 6:36 pm

l3v3rz wrote:Ive had a think :) and I have started coding this in, so it will be in the next version of DCMP and RobobuilderLib.

The .NET interface looks like this (added to wckMotion class)

public bool I2C_write(int addr, byte[] outbuf)
This will send all the bytes in outbuff to the slave 'addr'

public byte[] I2C_read(int addr, byte[] outbuf, int cnt)
This will send all the bytes in outbuf to the slave 'addr' and then
read 'cnt' bytes from the I2C bus.

So example will look like this to initialise the accelerometer:
Code: Select all
            wckMotion wmt = new wckMotion("COM5", true);

           // acc init
            if (!wmt.I2C_write(0x70, new byte[] { 0x14, 0x03 }))
            {
                Console.WriteLine("I2C test failed");
            }


Still testing the communication out - so should be available in a few days/next week

Edit:
here's an example of reading the accelerometer values
Code: Select all
   wmt.I2C_write(0x70, new byte[] {0x02});

   byte[] ib = wmt.I2C_read (0x71, new byte[] {}, 6);      
   Console.WriteLine("x={0}, y={1}, z={2}",
      wmt.cbyte(ib[1]) ,
      wmt.cbyte(ib[3]),
      wmt.cbyte(ib[5]));


cheers


Very Nice Bravo :D
l3v3rz wrote:Ive had a think :) and I have started coding this in, so it will be in the next version of DCMP and RobobuilderLib.

The .NET interface looks like this (added to wckMotion class)

public bool I2C_write(int addr, byte[] outbuf)
This will send all the bytes in outbuff to the slave 'addr'

public byte[] I2C_read(int addr, byte[] outbuf, int cnt)
This will send all the bytes in outbuf to the slave 'addr' and then
read 'cnt' bytes from the I2C bus.

So example will look like this to initialise the accelerometer:
Code: Select all
            wckMotion wmt = new wckMotion("COM5", true);

           // acc init
            if (!wmt.I2C_write(0x70, new byte[] { 0x14, 0x03 }))
            {
                Console.WriteLine("I2C test failed");
            }


Still testing the communication out - so should be available in a few days/next week

Edit:
here's an example of reading the accelerometer values
Code: Select all
   wmt.I2C_write(0x70, new byte[] {0x02});

   byte[] ib = wmt.I2C_read (0x71, new byte[] {}, 6);      
   Console.WriteLine("x={0}, y={1}, z={2}",
      wmt.cbyte(ib[1]) ,
      wmt.cbyte(ib[3]),
      wmt.cbyte(ib[5]));


cheers


Very Nice Bravo :D
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by Flid » Fri Jul 30, 2010 9:02 am

Post by Flid
Fri Jul 30, 2010 9:02 am

Hello l3v3rz,

Where I can download your last realease with I2C of DCMP and RobobuilderLib ? :oops:
Hello l3v3rz,

Where I can download your last realease with I2C of DCMP and RobobuilderLib ? :oops:
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by l3v3rz » Sat Jul 31, 2010 3:12 pm

Post by l3v3rz
Sat Jul 31, 2010 3:12 pm

Please have patience - I do only work on this in my spare time.

I haven't made available as a pre-built release yet, although the source is uploaded if you want to build it yourself. I'm working on a few other items before I create a new release as it requires updates to both robobuilderlib and dcmp.hex.

Have you interfaced any I2C sensors yet ? if so which ones and how about some pictures to show what you're up to.

l3v3rz
Please have patience - I do only work on this in my spare time.

I haven't made available as a pre-built release yet, although the source is uploaded if you want to build it yourself. I'm working on a few other items before I create a new release as it requires updates to both robobuilderlib and dcmp.hex.

Have you interfaced any I2C sensors yet ? if so which ones and how about some pictures to show what you're up to.

l3v3rz
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by Flid » Sat Jul 31, 2010 5:57 pm

Post by Flid
Sat Jul 31, 2010 5:57 pm

l3v3rz wrote:Have you interfaced any I2C sensors yet ? if so which ones and how about some pictures to show what you're up to.
l3v3rz


In fact, not yet :oops:

Not yet received my Devantech CMP03 compass module :D

Be patient, I will be :wink:

Flid
l3v3rz wrote:Have you interfaced any I2C sensors yet ? if so which ones and how about some pictures to show what you're up to.
l3v3rz


In fact, not yet :oops:

Not yet received my Devantech CMP03 compass module :D

Be patient, I will be :wink:

Flid
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by Flid » Sun Aug 01, 2010 7:37 pm

Post by Flid
Sun Aug 01, 2010 7:37 pm

i-Bot wrote:I put connectors where the accelerometer was and connected a remote board with accelerometer and I2C camera from wiimote. This works fine.


Amazing, I'm looking on internet about Wiimote IR camera, on Google, and i'm impresive by the possibility of this cheaper caméra. :shock:

Many libraries about this camera with this hack under .net :shock:

this add-on will be implemented on my robot. :P


Amazing , I'm looking on internet about Wiimote IR camera, on Google, and i'm impresive by the possibility of this not cheaper caméra.

Many libraries about this camera with this hack under .net

this add-on will be implemented on my robot.

Other, but interresting too
I will put too one 2.4Ghz vidéo camera, with OpenCV (in fact Emgu libraries in .NET :D) for vision of the true world.

So I'm very impatient to see the release of DCMP and RobobuilderLib from l3v3rz :wink:

See You :lol:
i-Bot wrote:I put connectors where the accelerometer was and connected a remote board with accelerometer and I2C camera from wiimote. This works fine.


Amazing, I'm looking on internet about Wiimote IR camera, on Google, and i'm impresive by the possibility of this cheaper caméra. :shock:

Many libraries about this camera with this hack under .net :shock:

this add-on will be implemented on my robot. :P


Amazing , I'm looking on internet about Wiimote IR camera, on Google, and i'm impresive by the possibility of this not cheaper caméra.

Many libraries about this camera with this hack under .net

this add-on will be implemented on my robot.

Other, but interresting too
I will put too one 2.4Ghz vidéo camera, with OpenCV (in fact Emgu libraries in .NET :D) for vision of the true world.

So I'm very impatient to see the release of DCMP and RobobuilderLib from l3v3rz :wink:

See You :lol:
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by Flid » Wed Aug 04, 2010 7:47 pm

Post by Flid
Wed Aug 04, 2010 7:47 pm

Flid wrote:
l3v3rz wrote:Have you interfaced any I2C sensors yet ? if so which ones and how about some pictures to show what you're up to.
l3v3rz


In fact, not yet :oops:

Not yet received my Devantech CMP03 compass module :D

Be patient, I will be :wink:

Flid


Devantech CMP03 compass module received :D

Try under .net with my PC and USB-I2C and working well :D ( done one little software to read I2C components 8) )

I know the .net dev platform but not really ATMEGA128 and AVR compilation with C :oops: ( question will coming later :? )

So l3v3rz, I need your wrapper with DCMP and RobobuilderLib :wink:

Take your time :D , I go in holidays for 1 week :wink:
I hope you will make the release when I be back :roll:

See You :lol:
Flid wrote:
l3v3rz wrote:Have you interfaced any I2C sensors yet ? if so which ones and how about some pictures to show what you're up to.
l3v3rz


In fact, not yet :oops:

Not yet received my Devantech CMP03 compass module :D

Be patient, I will be :wink:

Flid


Devantech CMP03 compass module received :D

Try under .net with my PC and USB-I2C and working well :D ( done one little software to read I2C components 8) )

I know the .net dev platform but not really ATMEGA128 and AVR compilation with C :oops: ( question will coming later :? )

So l3v3rz, I need your wrapper with DCMP and RobobuilderLib :wink:

Take your time :D , I go in holidays for 1 week :wink:
I hope you will make the release when I be back :roll:

See You :lol:
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by Flid » Sat Aug 14, 2010 11:49 am

Post by Flid
Sat Aug 14, 2010 11:49 am

Hi l3v3rz,

I rebuild DCMP and RobobuilderLib to test the I2C and working well with ACC Sensors :D This afternoon, I will make the hard modifications on Humo to include the compass. So, see you later :wink:

Here rebuild: DCMP_RobobuilderLib_with_I2C_beta_from_Flid.zip

Thank you again at l3v3rz for your work :P
Hi l3v3rz,

I rebuild DCMP and RobobuilderLib to test the I2C and working well with ACC Sensors :D This afternoon, I will make the hard modifications on Humo to include the compass. So, see you later :wink:

Here rebuild: DCMP_RobobuilderLib_with_I2C_beta_from_Flid.zip

Thank you again at l3v3rz for your work :P
Flid offline
Savvy Roboteer
Savvy Roboteer
Posts: 34
Joined: Sun Jul 11, 2010 11:34 pm

Post by l3v3rz » Sat Aug 14, 2010 6:18 pm

Post by l3v3rz
Sat Aug 14, 2010 6:18 pm

Ok great - official release out real soon now :)

Its also built into the BASIC as well so for doing rapid prototypes could be a good alternative. when you get your compass code working hope you can post and I'll add to the library

cheers
Ok great - official release out real soon now :)

Its also built into the BASIC as well so for doing rapid prototypes could be a good alternative. when you get your compass code working hope you can post and I'll add to the library

cheers
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Next
Next
24 postsPage 1 of 21, 2
24 postsPage 1 of 21, 2
cron