Questions regarding SPI (and I2C)


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    53

    Default Questions regarding SPI (and I2C)

    Hello,

    Having never experimented much with SPI (or I2C for that matter), I need to ask a rather basic question - Do SPI and I2C require the use of an accurate (eg. crystal) oscillator, or do they work ok with standard internal oscillators?

    What are the pros / cons of SPI vs. I2C?

    Regards,

    Andy

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: Questions regarding SPI (and I2C)

    Both can work with the standard internal oscillators without any fuss.

    I2C is 2 wires, SPI is 4 wire.

  3. #3
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default Re: Questions regarding SPI (and I2C)

    Thanks Jerson.

    Andy

  4. #4
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Questions regarding SPI (and I2C)

    I am not very familiar in using SPI, nor I2C for that matter, but as it is on topic and may help both the OP and myself...

    Is it correct that I2C must be initiated by the master always, so that the slave device cannot initiate a communication? Say, by example, an I2C clock cannot (by I2C protocol alone) initiate an interrupt (like by the second); rather, must wait for the master unit to read data and determine for itself that the second register is updated? Of course an interrupt line may be used - independent of the protocol - if one is available...

    SPI also has this interrupt built into the protocol and one of the required lines may signal that new data is available, yes? Therefore SPI may be more suitable for "active" devices? As our clock example above, the SPI clock (or other SPI device) may signal an updated second register so that the master unit may service this as an interrupt and not bother itself until notified by the slave.

  5. #5
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: Questions regarding SPI (and I2C)

    I2C has 2 variants I2Cmaster and I2Cslave. The master always is in command and the slave responds to the master initiated query/commands.

    SPI usually has 4 wires MISO, MOSI, SCLK, CS (Master In Slave Out, Master out slave In, serial clock, chip select). Some devices may signal availability of data on the MISO line when the CS is held inactive. That is implementation specific to that device.

    An interrupt line has no relation to the 2 protocols except you might be able to enable / disable the feature via the communications by setting of some register

  6. #6
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default Re: Questions regarding SPI (and I2C)

    I have another question - do SPI and I2C (using either software or MSSP) still work ok when interrupts are also in use?

    Andy

Similar Threads

  1. Beginner I2C Questions
    By rocket_troy in forum Serial
    Replies: 13
    Last Post: - 23rd May 2013, 02:08
  2. LTC2492 Code questions/16bit A/D, SPI
    By BUBBA2 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th January 2011, 20:01
  3. I2C howto questions
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 27th May 2010, 18:39
  4. i2c PBP questions
    By TimV in forum General
    Replies: 14
    Last Post: - 5th February 2007, 17:58
  5. Still new to PicBasic - i2c questions
    By cometboy in forum mel PIC BASIC
    Replies: 4
    Last Post: - 13th November 2006, 18:27

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts