SPI conversion from 4 ports to 3 ports

Discussion in 'General Electronics Chat' started by Liviu123, Apr 1, 2013.

  1. Liviu123

    Thread Starter New Member

    Mar 16, 2013
    11
    0
    With a SPI having 4 ports (DI, DO, CS and CLK) is needed to be realised the connection with a circuit containing an EEPROM which has 3 ports (DI/DO, CS and CLK). I am looking to an adapter which can do this conversion from 3 to 4 ports.
    Anyone who can come with a solution is wellcomed. Thank you. :)
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    You probably have to write to the device, tell it whether your are reading or writing, the address, and the device will either read, or write, depending on what you sent to it. In that case, you don't need an adapter, you just need the correct protocol.
     
    absf likes this.
  3. Liviu123

    Thread Starter New Member

    Mar 16, 2013
    11
    0
    Thank you tshuck. But electrically - for the SPI with 4 ports do you have to bind together DI with DO and then just a parallel connection to the electronic circuit which includes the EEPROM ?
     
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Come again?

    Your processor needs to be aware of what it is sending to the EEPROM, as this will decide the state of SDI/SDO those are the same pin, meaning it will serve both functions, under current circumstances.

    What are you referring to with the parallel connection? SPI is a serial interface....
     
    absf likes this.
  5. RG23

    Active Member

    Dec 6, 2010
    301
    2
    I don't think there is any need of adapter

    Just connect the DI/DO of EEPROM circuit to DO of the controller if you are writing the data from the controller to EEPROM
     
  6. Liviu123

    Thread Starter New Member

    Mar 16, 2013
    11
    0
    Don't be mechant tshuck. You didn't understand me. Parallel connection was referring clock from the circuit to clock from SPI; CS from the circuit to CS from the SPI; and now DI/DO from the circuit to where? Thanks a lot to RG23, he gave me the idea: a 2 position switch. If I want to read I put the switch on DI, if I want to write into eeprom I put the switch to on DO.
    I have an Arduino Eleven. Does have anyone an exemple of protocol to use in my case? I want to read and to write that eeprom. Many thanks.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    I'm not an aurduino guy so I can't help there but if you google

    "3 wire spi" & aurduino

    You will get some very relavant hits from people doing exactly that. Mitchtech.com in particular looks good.
     
  8. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    I think you need to go back and reread what I posted. it was a legitimate question, your explanation was hardly accurate, and referring to the connections add parallel is misleading. If a straight connection is considered parallel, what is serial?



    I doubt the switch will do anything. Most SPI interfaces like this are multipurpose SDI/SDO, meaning the direction is controlled by the commands words, not a pin. I would suggest posting a link to the datasheet.
     
    absf likes this.
Loading...