nabberuk
Posts: 66
Joined: Fri Mar 09, 2012 10:34 am
Contact: Website

Confusion

Sat Jun 30, 2012 5:19 pm

Hello,

I have a couple of questions that i'm a little confused about at the moment.

What's the difference between GPIO/SPI and I2C?

What are the differences in speed?
I'm looking to poll various sensors every second. (Accelerometer (X,Y and Z), Wind Direction) and based on the results change the position of a couple of servo's.

I'm confused on the 3 connections.

thanks
the autonomous sailing boat: www.autonboat.com

domesday
Posts: 258
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK

Re: Confusion

Sat Jun 30, 2012 6:38 pm

GPIO is a geral term to refer to the interface, General Purpose Input Output.
Some of the pins can be configured as a serial interface either I2C or SPI, SPI is the faster of the two.

User avatar
leon_heller
Posts: 89
Joined: Wed May 02, 2012 4:10 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.

Re: Confusion

Sat Jun 30, 2012 6:43 pm

I2C makes it easier to have several devices on the same bus, as each device has an address. SPI requires a chip select for each device on the bus.
Leon Heller
G1HSM

nabberuk
Posts: 66
Joined: Fri Mar 09, 2012 10:34 am
Contact: Website

Re: Confusion

Sat Jun 30, 2012 8:02 pm

Hi thanks for the replies.

Are there any specs on the speed difference between I2C and SPI?
the autonomous sailing boat: www.autonboat.com

User avatar
leon_heller
Posts: 89
Joined: Wed May 02, 2012 4:10 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.

Re: Confusion

Sat Jun 30, 2012 8:10 pm

Max. speed for standard I2C is 400 kHz. SPI depends on the clock, but can go up to 50 MHz.
Leon Heller
G1HSM

nabberuk
Posts: 66
Joined: Fri Mar 09, 2012 10:34 am
Contact: Website

Re: Confusion

Sat Jun 30, 2012 10:13 pm

So i'd be ok polling this sensor every second > http://www.hobbytronics.co.uk/lsm303dlh ... rd=compass

It's using I2C.

thanks
the autonomous sailing boat: www.autonboat.com

Return to “Automation, sensing and robotics”