Shop OBEX P1 Docs P2 Docs Learn Events
SPI interface — Parallax Forums

SPI interface

I'm working on connecting a digital potentiometer (MCP4132) to a BS2. I found the Basic Stamp II SPI to MicroChip 4131 Digital Potentiometer discussion which answers most of my questions but in the code there is mention of a 1k resistor on the signal line:

Datapin PIN 0 ' (SDI) Data = Pin 0 **USE 1K RESISTOR**

I do not see this used on other examples of SPI communications (SHIFTIN/SHIFTOUT). Anybody know what this is for?

Comments

  • kwinnkwinn Posts: 8,697
    Probably just for safety to limit current in case both pins became outputs with one low and one high.
  • Thanks. That helps. Subsequently, I found this on the datasheet:

    "On the MCP41X1 devices, pin-out limitations do not allow for individual SDI and SDO pins. On these
    devices, the SDI and SDO pins are multiplexed. The MCP41X1 serial interface knows when the pin
    needs to change from being an input (SDI) to being an output (SDO). The Host Controller’s SDO pin must be
    properly protected from a drive conflict."

    However, the MCP41X2 has separate SDI and SDO pins per the datasheet:

    "The SDI pin is the serial interfaces Serial Data In pin. This pin is connected to the Host Controllers SDO pin."

    So the resister should not be required on the MCP41X2?
  • kwinnkwinn Posts: 8,697
    If all you have is a single Master and a single Slave on the bus and both have separate SDI and SDO pins then you do not need the resistor. If you have multiple slaves on the bus with separate SDI and SDO pins I would put a resistor on each of the slaves output pins.
Sign In or Register to comment.