Home > spi > I2C and SPI ,if they share same connection , is there confilict or not

I2C and SPI ,if they share same connection , is there confilict or not

November 28Hits:1
Advertisement

We have a product which uses PIC18F4520, and we used some devices like LCD driver and so on, that all use I2C bus to comunicate with the micro. But now we want to add a couple of AD5504, which is a DAC with a SPI interface. We now have a question as to whether they could share the same connection with the I2C bus or not.

Do you have a good suggestion about it?

Answers

Another option would be to use an SPI to I2C bridge chip. This would essentially allow you to add a chip select for your entire I2C bus. One such option is shown below.

http://www.silabs.com/products/interface/spitoi2c/Pages/default.aspx

If this AD5504 thing (you didn't provide a link) is another IIC device, then everything should be fine. If it is something else, like SPI, then no, that won't work. A SPI device can be made to ignore MISO and MOSI by not asserting its slave select, but a IIC device will get very confused by normal MISO and MOSI signals on the SCL and SDA lines. Even a cursory look at the IIC spec would have revealed that.

You may be able to bit-bang one of the interfaces through a general purpose I/O pin, leaving the special function pins for the other interface.

You might be able to gate one of the signals - particularly the clock - with something enabled by an output pin, so that it doesn't reach the chip which is not currently the target.

You could try to find peripherals which all use the same interface.

At an extreme, you can add a second micro as a slave to function as a format converter. The isn't too expensive parts wise, but it means another program to maintain, and load into each device in production.

An I2C device will silently ignore everything that happens on the bus until it sees a falling edge on SDA while SCK is high, followed by eight low-high-low cycles of SCK during which SDA never changes while SCK is high, and where SDA switches state on certain transitions while SCK is low. Therefore, an I2C device may safely share a bus with devices using some other protocl if the above sequence of events can be guaranteed never to occur except when trying to talk to the I2C device.

It would be possible (and not at all difficult) to have a "bit-bang" software SPI implementation ensure that the above sequence of events never occurs. Hardware SPI implementations, however, will often not allow for such a guarantee. Typically, the data output will by design change either at the same time as the clock rises, or at the same time as the clock falls. If the data wire were consistently to change state after the rising edge of the clock wire or before the falling edge thereof, there would be no possibility of SPI data being mistaken for an I2C start and addressing sequence. If the signals change at the same time, however, it would be possible that an I2C device might see some transitions happening before the clock edge and some happening after, in such a way as to be interpreted as an I2C address sequence.

Tags:spi, i2c

Related Articles

  • I2C and SPI ,if they share same connection , is there confilict or notNovember 28

    We have a product which uses PIC18F4520, and we used some devices like LCD driver and so on, that all use I2C bus to comunicate with the micro. But now we want to add a couple of AD5504, which is a DAC with a SPI interface. We now have a question as

  • Can I use both I2C and SPI at same time with PIC16F1503

    Can I use both I2C and SPI at same time with PIC16F1503April 28

    Im new to Microchip microcontrollers and I'm looking for very low cost device with I2C and SPI. I want to connect one I2C (ADC) and one SPI device (LCD). I found this very low cost device: However it looks like I2C and SPI share same hardware. Questi

  • BMA180 accelerometer. How does it manage to share pins between I2C and SPI?

    BMA180 accelerometer. How does it manage to share pins between I2C and SPI?June 26

    BMA180 accelerometer can be either SPI slave or I2C slave. The pins for both buses are shared. SPI mode I2C mode --------------------------------------------------- SDI input SDA bidirectional (!) SDO output ADDR address bit, input SCLK input SCL inp

  • Using I2C and SPI communication on the same same clock and data lines

    Using I2C and SPI communication on the same same clock and data linesJune 19

    I am using a PIC18F25K80 with multiple slave devices. All of them uses I2C except one. What i want to know is that can i first use I2C with the devives that uses I2C and then close I2C, change clock speed and switch to SPI mode ? Is this poosible wit

  • I2C and SPI Bus Routing

    I2C and SPI Bus RoutingNovember 24

    When routing an I2C (SDA, SCL) bus or SPI (SCLK, MOSI, MISO) bus to multiple slaves is it preferred to wire the slaves in parallel or series? Below are two diagrams with distances labeled to help with answering. In all schematics I see people seem to

  • How to find out how many sensor you can add to a I2C or SPI protocol?

    How to find out how many sensor you can add to a I2C or SPI protocol?February 13

    I am having problems to find out exactly how to connect sensors to make a project. The main issue is that I cannot find a device that can drive enough analog sensor, so I need to use either SPI or I2C. Now, I have noticed that some sensor basically h

  • How to share ethernet connection on Ubuntu (Jaunty)?July 5

    I've googled it and I've found mostly tutorials on sharing when having 2 ethernet ports. I am in a hotel with only wired connection (eth0). I would like to use my wifi card to share my connection with other computers and be able to switch the wifi ba

  • Win 7: Share internet connection via Ethernet and WiFi

    Win 7: Share internet connection via Ethernet and WiFiMay 19

    I have the following configuration: Box 1. Running Win 7, connected to the Internet via Eth0. Has one wireless network adapter and one another ethernet adapter (say, Eth1). Box 2. Running Win XP, has one ethernet adapter. I'd like to share Internet c

  • share internet connection using pointopoint methodJanuary 30

    I'm trying to share internet connection between two host using ethernet device and using pointopoint method but havent yet get any proper response, Here is the chronology: setting ip : host a ifconfig eth0 10.0.1.1 pointopoint 10.0.1.2 netmask 255.25

  • Is there a tool that lets me share internet connection through Wifi?March 15

    I really like OS X's ability to share the internet connection through everything within several mouse clicks, but it seems that the Mac is doing something funny that prevents Linux machines from connecting. Is there a Linux software that lets me do t

  • Share adhoc connection with Playstation 3 May 23

    I'm using a mobile internet connection on my Ubuntu laptop, and I'm sharing it (wlan) using adhoc. The problem seems to be that it only works using WEP security, but my PS3 can not connect to, or even find, the shared wireless network. I've tried usi

  • Home Router, Fairly Share Internet ConnectionSeptember 26

    I have just moved into a new house with some friends at my University! Exciting times, but what we didn't realise is that we are all heavy internet users, currently causing problems in the house. The problem appears to be that if someone starts say s

  • Share internet connection over Wi-Fi

    Share internet connection over Wi-FiDecember 23

    I am using MacBook Pro with Snow Leopard, and my system is connected to internet via wired broadband connection. I want to share internet connection from my MacBook Pro via Wi-Fi, so I can connect other devices to internet. How can I achieve this? --

  • Share internet connection

    Share internet connection August 4

    I have Ubuntu 12.04 on a HP 430 notebook and this has a single wired internet connection and I would like to share this with a LG Optimus One with Android 2.3.3. I followed these instructions and created a hotspot as shown below, but UbuntuHost is no

  • How do I configure Ubuntu to share wifi connection with a single computer on a LAN?

    How do I configure Ubuntu to share wifi connection with a single computer on a LAN? August 4

    I have Ubuntu 12.04 on a HP 430 notebook and this has a single wired internet connection and I would like to share this with a LG Optimus One with Android 2.3.3. I followed these instructions and created a hotspot as shown below, but UbuntuHost is no

  • Share VPN connection established with Cisco VPN Client on a MacBook?

    Share VPN connection established with Cisco VPN Client on a MacBook?October 9

    Is it possible to share my VPN connection established with a Cisco VPN client to other devices via network sharing on my MacBook? --------------Solutions------------- Yes. Go into System Preferences, select Sharing, then choose Internet Sharing. When

  • Can I share internet connection with my access point?December 26

    I have internet connection from isp that use mikrotik. So if want to connect to internet I must to login to mikrotik login page. My problem is isp is limiting the login. So if I want my phones, tablet, etc, I must disconnect my laptop first. The ques

  • What are some good older devices that I can scrounge i2c or spi modules from?May 10

    I am a newcomer to electronics design and I'd really like to start fiddling with making my own circuits. I have a raspberry pi which has both I2C and SPI interfaces, and I'm wondering if there's any classes of older equipment that might have these so

  • How to share internet connectionJuly 2

    I have a LG P500 with Android 4.1 and I want to share internet connection(LAN) to it. I have USB cable(for phone), bluetooth dongle, wifi dongle(TL-WN821N) to use. --------------Solutions------------- You can do a reverse tethering. Take a look here

  • Share WiFi connection via the Ethernet port on Windows 8August 26

    How can I share the Internet signal a Windows 8 PC receives via the WiFi adapter thru the Ethernet port to another device that does not have a WiFi adapter? In other words, the Windows 8 PC connects to the internet via a wireless connection, and I'd

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.675 s.