--- In Electronics_101@..., "lcdpublishing"
<lcdpublishing@...> wrote:
Hi Guys,
Having lost enough hair trying to get i2C working with BASCOM, I
dropped it and switched to the SPI interface. Got that working
within a couple of minutes as opposed to countless hours getting
nowhere with i2C.
Anyway, being new to SPI, I don't know what the limitations are for
it. I would like to have the SPI master in a sepperate cabinet from
some of the SPI slaves. I am guessing the total cable length would
be about 3 feet - shielded cable if that maters.
I will try a test on the breadboard (yes, I am doing this on a
breadboard :-)). But I would also like to hear if there are any
cautions etc.
Thanks guys
SPI as implemented by the micro is still a 5v logic signal although it
does have active pull-up. Cable capacitance didn't improve with the
change in protocol so I wouldn't expect it to run at longer distances,
at least not a lot longer. The thing with SPI is that it wants to run
a lot faster than I2C. This is going in the wrong direction for using
long lines.
So, you will have to watch the speed and look at the signals with a
scope. Long rise times will be just as much of a problem with SPI as
it is with I2C.
I2C can be a bear to debug. However, there are bus buffers available
- at least one of which will extend I2C to one mile. But, it is
another component, more board space, etc.
I haven't implemented it but I do like the ROBIN protocol for RS485
over at BDMicro - That may be out
of the question for Basic. It's probably not a coincidence that both
of the current BD Micro boards have RS485 drivers with ATmega128 chips.
Richard
Chris