0503-08 MAX31855 ADC thermocouple

Example Projects > 0503 Generic SPI Communication > 0503-08 MAX31855 ADC thermocouple

Reading the MAX31855 thermocouple ADC via SPI

This folder contains the source files for reading data from the MAX31855 thermocouple ADC via SPI bus, which is available e.g. on the Raspberry Pi minicomputer. The example is based on the REXLANG user-programmable function block of the REXYGEN.

The data obtained from the thermocouple converter are displayed in raw format and converted to temperature readings using the LIN function block.

The CNDR function block can be used for additional nonlinearity compensation.

The time plot of the measured data can be displayed in the REXYGEN Diagnostics.


  • REXYGEN Runtime Core must be installed and running on the target device (e.g. Raspberry Pi).
  • SPI bus must be enabled and available (e.g. /dev/spidev0.0 on the Raspberry Pi)
  • The wiring must comply with the attached datasheet.

Timing of the project

The algorithm runs each 500 milliseconds (0.5 s). See the EXEC function block,
tick x ntick0 = 0.05 x 10 = 0.5

Running the example

  • The *exec.mdl file is the project main file.
  • Open it with REXYGEN Studio.
  • Specify the SPI bus by the p0 parameter of the REXLANG function block.
  • Compile and download it to the target device.
  • Switch to Watch mode and observe the algorithm.
  • The received data is displayed. Time plot is available upon double-clicking the TRND block.


-- Press F1 for help on the selected function block in the REXYGEN Studio.

Additional information

  • Raspberry Pi is a trademark of the Raspberry Pi Foundation.
  • Visit the REXYGEN webpage for more information about the example projects and developing advanced automation and control solutions using REXYGEN.