🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    SPI on M5Tough (MAX31865)

    Cores
    2
    3
    3.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      GrtVHecke
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        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>);
        

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • G
          GrtVHecke
          last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post