Jump to content
43oh

Peripheral connection between devices.


Recommended Posts

When connecting two devices( lets say two dev boards ) via I2C, or SPI. Is there any additional circuitry needed, or is is safe to directly connect them ?

 

The specific boards I'm thinking of are two TI derived boards. A Beaglebone black, and any of the launchpads really. I have several launchpads. The MSP430 1.5, LM4F120 launchpad, and now a TivaC connected launchpad. I'm also pretty sure directly connecting UART is safe, but I've actually only done this from a MSP430 v1.5 launchpad to the serial debug header on the beaglebone black.

 

EDIT:

 

One thing that kind of bothers me, but might be a moot point ? Is that the Beaglebone black can come up with pins in undesirable modes. Then of course if this is the case, the pinmux might be bad, or configured incorrectly until the OS is loaded and running. Or is this less of a problem, or moot completely ?

Link to post
Share on other sites

I2C need pull-up resistors to one of the respective Vcc voltages... and ideally the two should be powered at the same Vcc level, i.e. with the same power supply.  If not, you should make sure the two boards' Vcc voltages are VERY close.

 

SPI you generally connect directly with no pullups, although pullups (or pulldowns) may optionally be used but should be a very high value resistor.  The Chip Select line, if used, should have a pullup resistor on it just for stability sake.

 

Paul Stoffregen, who made the Teensy MCU board, has a different take on SPI bus, particularly when there are more than 1 slave device involved- see http://dorkbotpdx.org/blog/paul/better_spi_bus_design_in_3_stepsfor his discussion on how the circuitry should look there.

Link to post
Share on other sites

So, in other words, neither are something I can hook up directly like UART, and have it just work. @@spirilis So this pullup you're speaking of is in addition to the pin internal pullup / pulldown ? I'm not even sure if the pins can have pullup/pulldown enabled when operating in one of these modes, or not. Or, even if that is advisable.

Link to post
Share on other sites

So, in other words, neither are something I can hook up directly like UART, and have it just work. @@spirilis So this pullup you're speaking of is in addition to the pin internal pullup / pulldown ? I'm not even sure if the pins can have pullup/pulldown enabled when operating in one of these modes, or not. Or, even if that is advisable.

Correct, external to the MCUs. Probably on a small breadboard next to the project.

 

For I2C you want something around 4.7K ohm for each of the 2 pullups.

 

For SPI (chip select and maybe the other lines), something greater than 10K ohm is probably about right (100K might be the highest I would personally go).

Link to post
Share on other sites

I2C is an open-drain system, so you must use pull-ups to have defined levels. Those may be internal, but you'd have undefined behaviour until the master is powered up. SPI is push-pull, just like UART, but contrary to UART there is no clear dropping edge to define the start of communication, hence you should define the level of CS# by adding a pull-up to force the slave disabled during power up.

Alternatively you might force the slave device to power up after the master device, and thus make sure no undefined levels are ever received by it.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...