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


Groups > sci.electronics.design > #453697

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-26 02:37 -0400
Organization A noiseless patient Spider
Message-ID <ob7nd0$nvi$1@dont-email.me> (permalink)
References <ob4lm9$k58$1@reader1.panix.com> <ob6b9p$9a2$1@dont-email.me> <ob7f1h$ktg$1@reader1.panix.com>

Show all headers | View raw


On 3/26/2017 12:11 AM, David Lesher wrote:
> rickman <gnuarm@gmail.com> writes:
>
>
>
> .....
>
>> 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.
>
> This would be driven by a
> <http://www.digital-loggers.com/plchw.html>
> which claims to support both flavors.

I can't find how this "PLC Hardware" item fits into their product line. 
Your web page shows this item, but every page I find on their site only 
points to a wifi PLC.  Is this the same thing?  They also have videos on 
every page which I hate!

Oh, I see.  The page you link to is for the "hardware" and the other 
pages are a general PLC page and a software PLC page, etc.  $89 sounds 
like a bargain.


> Data rate is virtally irrelevent here; I need a response time
> far slower than the relays themselves are.....
>
> My hand may be forced by what boards are actually available. I
> found <https://www.industrologic.com/r8spiprod.htm> and

The manual for this one says it uses optoisolators on the inputs with a 
1 kohm current limiting resistor.  They recommend a minimum of 0.5 mA 
current, bit prefer 10 mA.  10 mA would require 12 volt drive.  The 
digital outputs on the PLC are open collector relay drivers.  They will 
be compatible and you can use the power supply to the PLC as the common 
power to the + terminal on each of the three SPI signals.  Or I think I 
see a direct input connector for the open collector outputs, J1.  They 
don't mention using these inputs, but what's the diff?  The optos will 
be less sensitive to noise I expect.  There is some irony in that they 
are using the same relay drivers your PLC uses for the digital outputs.

This unit has no serial output, so the SPI protocol will require this 
unit to be used *only* in the parallel mode with a dedicated strobe.

To drive 24 relays will use five digital outputs.


> <http://lightsosoft.com/sites/default/files/I2C-Relay8-H_040813_1240.pdf>

This board seems to be I2C only.  That would require I2C support in your 
PLC.  Does the PLC have that in the software?


> but many other boards are not what they seem to be, or are from across the pond.
> <http://jap.hu/electronic/relay_module.html>

Another I2C board.

> Not sure I grasp "wire three boards serially" but we can spare chip select
> outputs.

Normally SPI devices have a serial data input MOSI (master out, slave 
in) and and serial output MISO (care to guess what this one means?).  If 
you connect the MISO of the first module to the MOSI of the second 
module, etc before connecting the MISO of the last module to the MISO of 
the master module it will form a daisy chain of N * 8 bits.  So the PLC 
will need to shift out 24 bits before removing the strobe.  But the one 
SPI relay board has no serial output (MISO) and must be used in 
parallel.  Then the PLC output will drive all the MOSI (aka data) inputs 
together as well as a PLC output that will drive all the Clock inputs 
together.  The Strobe signals will all have to be separate.

With I2C, you just wire the two outputs to each of the two inputs on all 
three boards (with a pullup resistor somewhere in the path).  The relay 
boards will need to have jumpers to set a unique address on the bus. 
Each byte you wish to send to control a set of relays requires two 
bytes, one to set the address and one to set the data.

Just a comment, some of the lightsosoft.com documentation isn't so 
clear.  I'm not sure how to wire up the I2C interface.  This is what 
they say:

The specific pins you need for I2C communications are:

TB19, “SDA”
TB20, “SCL”
TB18, “GND”
TB19, “5V”

I see none of these notations in any of the illustrations.  I could make 
an educated guess, but why can't they make it clear in the manual *AND* 
on the board?  The notation they show looks like JTAG and SPI labels. 
Ask if they have an SPI version of the board.  I bet they do.

-- 

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