Page 1 of 1

Confusion

Posted: Sat Jun 30, 2012 5:19 pm
by nabberuk
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

Re: Confusion

Posted: Sat Jun 30, 2012 6:38 pm
by domesday
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.

Re: Confusion

Posted: Sat Jun 30, 2012 6:43 pm
by leon_heller
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.

Re: Confusion

Posted: Sat Jun 30, 2012 8:02 pm
by nabberuk
Hi thanks for the replies.

Are there any specs on the speed difference between I2C and SPI?

Re: Confusion

Posted: Sat Jun 30, 2012 8:10 pm
by leon_heller
Max. speed for standard I2C is 400 kHz. SPI depends on the clock, but can go up to 50 MHz.

Re: Confusion

Posted: Sat Jun 30, 2012 10:13 pm
by nabberuk
So i'd be ok polling this sensor every second > http://www.hobbytronics.co.uk/lsm303dlh ... rd=compass

It's using I2C.

thanks