What's I2C, how does it work and how to expand a PICAXE Project Board with it

Hi all, I'm quite new about the things discussed in this site, I've completed successfully the first robot guide that is suggested to new users and now I want to make another step building an hexapod.

Since, as I said, I've followed the beginners robot guide, I have a PICAXE Project Board and a PICAXE 28X1 microcontroller. I'm going to order 18 servos and use 3 of them for every leg (you don't say?!) of the hexapod.

Ok, now looking at the documentation linked in the first robot tutorial, I've understood that I can connect a max of 8 servos to the board, so I need an expansion board. I've found this one on the PICAXE website that alone can control up to 21 servos, so it just suits my needs!


Now all the I2C related doubts come out :P

How does this bus work?

Can I extend the project board with the 21 channel board through the I2C bus?
If yes, which pins are interested by this link?
How is a I2C connection cable? (I've searched on google but a lot of different cable images came out -.-' )


I2C experts, come out!!! :D

That damn FM!

You should also look over the hi2cin, hi2cout, and hi2csetup commands in PICAXE Manual 2.

Regarding your questions:

How does this bus work?

I believe OddBot’s advice will yield you an excellent explaination.

Can I extend the project board with the 21 channel board through the I2C bus?

Yes. Also, you won’t need the additional 18M2 or other optional chips if you have a 28x Project Board already.

If yes, which pins are interested by this link?

You can check the “pinout diagrams (older parts)” in Manual 1 for this. The 28X1 uses pins 14 and 15 for SCL and SDA, respectively. They are labelled In 3 and In 4 on the project board.

How is a I2C connection cable? (I’ve searched on google but a lot of different cable images came out -.-’ )

Also described in OddBot’s link. In short, it’s just two wires with a pullup resistor on each line. 

I searched for “picaxe sd21 i2c” in the searchbox here. I found this link that might help you wrap your head around the servo interface…

https://www.robotshop.com/letsmakerobots/node/21822

Quick note

I was looking over the code on the link I gave you and I noticed it uses some old commands that I’m not even sure are supported anymore (untested disclaimer). If they don’t work for you, use HI2CSETUP instead of I2CSLAVE and use HI2COUT instead of I2CWRITE

this link is for arduino,

this link is for arduino, but still might be helpful:

http://tronixstuff.wordpress.com/2010/10/20/tutorial-arduino-and-the-i2c-bus/

http://tronixstuff.wordpress.com/2010/10/29/tutorial-arduino-and-the-i2c-bus-part-two/

 

 

You may be interested in

You may be interested in reading the official I2C specification, its somewhat of a dry read but you will learn how the I2C bus works which can save you some headaches and debugging time down the road.

Just for fun…

Just for fun I typed “picaxe 21 servo” in to the search box here at LMR. I came up with this:

https://www.robotshop.com/letsmakerobots/node/21822

I could not help but notice the last post was labeled “I managed to get it working” and included some example code.

–Not sayin’, just sayin’.

I will check those link out,

I will check those link out, thank you rogue and Chris :wink: