SPI question

If I need to read and write registers to an SPI device, do I need to define say pins 8 and 9 one for read and one for write?

Yes, MOSI is Master Out Slave In. (Imp writes to slave chip)
MISO is Master In Slave out. (slave chip writes to Imp)
SPI189 and SPI257 both have MISO, MOSI and SCLK pins and you must use those specific pins to read and write. MakeDeck C3V0’s and P3V3’s have the pin-out listed on the back of the board.

More details on SPI here: SPI Explained

The reason I ask is that the various examples I see only define the SPI 189 or 257 and map the CS pin.

Similar to this:
ss.configure(DIGITAL_OUT); ss.write(HIGH);

The breakout I am working with doesn’t appear to be taking the write commands so I was wondering if I had to map another pin for writes.

Maybe I have this wired incorrectly. Here are the pin designations:

DRDY
SDO
CS
SCLK

VIN
ground

Would DRDY be MOSI?

wiki spi

SDO=MOSI

i am not sure DRDY is related to the SPI bus. It might be something you need to poll or something you might use on an interrupt. Seems like it is a “Data Ready” pin.

From the chip datasheet: Active-Low Push-Pull Data-Ready Output. DRDY goes low when a new conversion result is available in the data register. When a read-operation of an RTD resistance data register occurs, DRDY returns high.

@mjkuwp94 Any recommendations on how to wire that pin set?

What’s the device? It seems like it’s a read-only device.

You’d connect:

  • CS to a GPIO output (chip select)
  • DRDY to a GPIO input (signal that data is ready, maybe with a pin change handler)
  • SDO to MISO (data input to imp)
  • SCLK to CLK (clock output to device).

@Hugo it is an RTD breakout board based on the MAX31865 chip.

http://www.playingwithfusion.com/include/getfile.php?fileid=7020

That chip does have an SDI pin, is it not on the breakout? This would appear to be required looking at the datrasheet. Hook that to the imp’s MOSI pin.

The Arduino code doesn’t require an SDI from what I can tell given my non-existent Arduino skills. Here is the board: http://www.playingwithfusion.com/productview.php?pdid=25&catid=1001

The config I am sending to the board is set to 60Hz. Should I change that to 50Hz?

Sorry, no idea what the chip is doing, I’m just addressing the interface.