1
\$\begingroup\$

I want to communicate with a MAX31856 using SPI. Unfortunately, I have a basic understanding of electronics and only used SPI communication once. Briefly, the thermocouple sensor (MAX31856) is connected via SPI to Arduino and the latter is connected to a computer. The temperature is read using LabView and the Linx Makerhub add-on. The MAX31856 works perfectly fine using the Adafruit libraries for Arduino.

The MAX31856 chip requires a serial data input (SDI) to set some parameters and simply to require a temperature value from the chip (From the datasheet: communication with the MAX31856 is accomplished through 16 8-bit registers that contain conversion, status, and configuration data). I do not understand what to send via the SDI pin. In the register memory map, I can see that the three addresses 0Ch, 0Dh and 0Eh respectively read the temperature bytes 2, 1 and 0. Do I have to send an array of three bytes with the value of 12, 13 and 14 (because in Labview the array is unsigned byte 0-255) to get the temperature back?

Maybe the difficulty also resides in my LabView code. In this case I will go on a more appropriate forum. Thank you in advance for your help. If you have any question on my problem, do not hesitate.

\$\endgroup\$
1
  • \$\begingroup\$ This a bit broad a question to belong here. Perhaps do a web search and see if you can find example code for operating the chip in some language and then translate. It seems like you'd actually be speaking SPI from the Arduino and then reporting only results back to Labview, and the Arduino could translate to whatever sort of numbers labview likes. \$\endgroup\$ Commented Sep 17, 2020 at 14:39

1 Answer 1

1
\$\begingroup\$

From the MAX31856 datasheet https://datasheets.maximintegrated.com/en/ds/MAX31856.pdf Figure 6 SPI Multibyte Transfer, the address byte is the first byte sent with CS low, all subsequent bytes sent are for write data. And for reading data, the first byte sent with CS low is the address byte, and all subsequent bytes sent are ignored (while the data bytes are output in sequence on bytes 2, 3, 4, etc.)

So to read the temperature data, assert CS low and then transmit the read command 0Ch (binary 0000_1100) followed by three 'dummy' bytes of all 0 (the actual value doesn't matter), with CS still held low the whole time. During the 4-byte SPI transfer, the received data will be one dummy byte (during the address) and the three bytes of data, TC temperature byte 2, byte 1, and byte 0. CS must return high after the SPI transfer completes, since it is the falling edge of CS that identifies the start of the read/write command.

(full disclosure: I am an applications engineer at Maxim Integrated)

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for your answer! I am not yet able to communicate with it but I understand much better the communication. \$\endgroup\$
    – Axel T.
    Commented Oct 2, 2020 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.