Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #453581

Re: Output boards, SPI vs I2C

From rickman <gnuarm@gmail.com>
Newsgroups sci.electronics.design
Subject Re: Output boards, SPI vs I2C
Date 2017-03-25 14:04 -0400
Organization A noiseless patient Spider
Message-ID <ob6b9p$9a2$1@dont-email.me> (permalink)
References <ob4lm9$k58$1@reader1.panix.com>

Show all headers | View raw


On 3/24/2017 10:46 PM, David Lesher wrote:
> I pondering a microcontroller project that will need a number (say 24)
> output relays.
>
> Is there a reason to use I2C over SPI? It looks like there are 8-channel
> boards of both ilks, and I don't know if one has an advantage in this case.

I2C is a serial bus (with a spec) with all devices connected in 
parallel.  SPI is a functional description rather than a real spec, but 
is so simple it is not hard to make it work.  SPI devices can be 
connected in parallel with separate select pins, or all in series being 
controlled as one long shift register.

I2C runs at a basic rate of 100 kbps with a 400 kbps mode as well as 
faster modes at 1 Mbps and up.  400 kbps is generally supported, but the 
faster modes are not universal.  SPI runs at whatever speed the devices 
work at.

I2C has a protocol that you will need to program.  SPI specified no 
protocol other than shifting data in and out.  Any protocol is defined 
by the slaves you choose.

All things being equal (whatever that means as I2C and SPI have very 
little equal) I would pick SPI for driving 24 relays because the 
"protocol" should be very simple (shift out the data) and I2C can be 
more complex to implement.

I'd probably wire three boards serially and see if that works.  If not, 
I would wire them in parallel with three separate chip selects.

-- 

Rick C

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-25 02:46 +0000
  Re: Output boards, SPI vs I2C krw@notreal.com - 2017-03-24 23:25 -0400
    Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-26 04:13 +0000
  Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-03-25 14:04 -0400
    Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-26 04:11 +0000
      Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-03-26 02:37 -0400
        Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-26 14:41 +0000
          Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-03-26 12:47 -0400
            Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-26 19:49 +0000
              Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-03-27 10:49 -0400
                Re: Output boards, SPI vs I2C Jasen Betts <jasen@xnet.co.nz> - 2017-03-27 18:41 +0000
                Re: Output boards, SPI vs I2C Martin Riddle <martin_ridd@verizon.net> - 2017-03-27 19:07 -0400
                Re: Output boards, SPI vs I2C Jasen Betts <jasen@xnet.co.nz> - 2017-03-28 08:03 +0000
                Re: Output boards, SPI vs I2C Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-03-28 10:44 -0400
                Re: Output boards, SPI vs I2C Jasen Betts <jasen@xnet.co.nz> - 2017-03-28 18:59 +0000
                Re: Output boards, SPI vs I2C Martin Riddle <martin_rid@verizon.net> - 2017-03-28 15:37 -0400
                Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-04-03 17:49 +0000
                Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-04-03 15:18 -0400
                Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-04-04 02:59 +0000
                Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-04-04 00:54 -0400
                Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-28 05:08 +0000
                Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-03-28 02:16 -0400
  Re: Output boards, SPI vs I2C Martin Riddle <martin_ridd@verizon.net> - 2017-03-27 19:03 -0400
    Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-28 03:28 +0000
      Re: Output boards, SPI vs I2C rickman <gnuarm@gmail.com> - 2017-03-28 00:38 -0400
        Re: Output boards, SPI vs I2C David Lesher <wb8foz@panix.com> - 2017-03-28 14:47 +0000

csiph-web