Read temperature from RPI2 on Windows 10 IoT with MAX31865 failled

Romain THOMAS 6 Reputation points
2020-12-02T08:54:49.957+00:00

Hello,
I am trying to read the temperature on a PI2 with Windows 10 IoT but I always have 0 as returned value for MAX31865_CONFIG_REG or MAX31865_RTDMSB_REG

The sample in python works fine with Raspian
https://learn.adafruit.com/adafruit-max31865-rtd-pt100-amplifier/python-circuitpython

I tryed with .Net5 and UWP but I have the same result

Did someone already succeed in reading the temperature ?
Could you share your experience please ?

Thank you for your help

Romain

Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
401 questions
.NET Internet of things
.NET Internet of things
.NET: Microsoft Technologies based on the .NET software framework.Internet of things: A concept that aims to extend the benefits of the regular internet, including constant connectivity, remote control ability, and data sharing, to goods in the physical world.
30 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Romain THOMAS 6 Reputation points
    2020-12-02T10:35:26.617+00:00

    My bad

    I forgot to controle the CS pin

            controller = GpioController.GetDefault();
            var cs = controller.OpenPin(5, GpioSharingMode.Exclusive);
            cs.SetDriveMode(GpioPinDriveMode.Output);
            cs.Write(GpioPinValue.High);
    
    
        public void writeRegister8(byte addr, byte data)
        {
            cs.Write(GpioPinValue.Low);
    
            Console.WriteLine($"Write at adress {addr}: {data}");
    
            addr |= 0x80; // make sure top bit is set
            addr &= 0xFF;
    
            byte[] buffer = { addr, data };
            spi_dev.Write(buffer);
    
            cs.Write(GpioPinValue.High);
        }
    
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.