SPI on M5Tough (MAX31865)

  • I have done several projects with the M5Tough and I really love the device. However I need an SPI connection now on the M5Tough to communicate with a MAX31865 for reading out temperatures from a PT100. This is a real requirement I can not use something else than a PT100!
    I always use Arduino code for the M5Tough, how can I configure the pins on the extensions board as (software) SPI pins and have it working with the Adafruit arduino Library?
    Can you please get me started/help me out here please?

  • Hello @GrtVHecke

    software SPI can be assigned to almost any GPIO - just select four GPIOs available on port A (GPIO33 / 32), port B (GPIO36 / 26) and C (GPIO13 / 14).
    Note: GPIO36 can only be an input

    In you sketch use this line:

    // Use software SPI: CS, DI, DO, CLK
    Adafruit_MAX31865 thermo = Adafruit_MAX31865(<CS>, <MOSI>, <MISO>, <SCK>);


  • @felmue thank you for this quick and excellent reply!!! I will do this. Can you just tell me if I need to specify the pins as GPIO33 or 33 in the constructor