MAX31855 Driver

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

MAX31855 Driver

Post by deshipu » Wed Feb 08, 2017 11:19 pm

I made a driver for the MAX31855 thermocouple amplifier. The code is at https://bitbucket.org/thesheep/micropython-max31855

Primesty
Posts: 49
Joined: Sun Jun 28, 2020 11:06 pm

Re: MAX31855 Driver

Post by Primesty » Fri Sep 25, 2020 3:14 pm

Hey deshipu the link for the max31855 driver is not working anymore. Does anyone happen to have the raw .py driver file they’d be willing to share with me and/or are aware of another driver that works for the adafruit max31855 thermocouple breakout?

I’d appreciate it!

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: MAX31855 Driver

Post by mcauser » Sun Sep 27, 2020 11:58 am

Deshipu's bitbucket is missing heaps of repositories, now that Atlassian has dropped mercurial support.
https://bitbucket.org/blog/sunsetting-m ... -bitbucket

Hi @deshipu, I cloned heaps of your repos, so if you've lost anything, I may have a copy that I can zip and send back.

Primesty
Posts: 49
Joined: Sun Jun 28, 2020 11:06 pm

Re: MAX31855 Driver

Post by Primesty » Sun Sep 27, 2020 2:19 pm

Hi guys,

Thanks for all the input here. I'll def check it out.

I was actually to get it to work without a 'real' driver on my ESP31 (MicroPython v1.13) based on this old adafruit document:

https://cdn-learn.adafruit.com/download ... evices.pdf

Code: Select all


from machine import Pin, SPI
import time

cs = Pin(13, Pin.OUT)

spi = SPI(-1, baudrate=5000000, polarity=0, phase=0, sck=Pin(5), mosi = Pin(10), miso=Pin(4))
# MOSI has to be defined BUT is not needed to read data


def read_temp(cs, spi):
    while True:
        try:
            data = bytearray(4)
            cs.value(0)
            spi.readinto(data)
            cs.value(1)
            print(data)
            temp = data[0] << 8 | data[1]
            if temp & 0x0001:
                return float('NaN')
            temp >>= 2
            if temp & 0x2000:
                temp -= 16384
            print(temp * 0.25)
        except:
            pass
        time.sleep(1)

read_temp(cs, spi)

This works surprisingly well even when I run it in an async application with uasyncio.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: MAX31855 Driver

Post by deshipu » Mon Sep 28, 2020 7:50 am

By the way, all the deleted Bitbucket repos have been archived by Software Heritage, for example: https://bitbucket-archive.softwareherit ... 31855.html

Corruptsector
Posts: 4
Joined: Mon Nov 02, 2020 9:12 am

Re: MAX31855 Driver

Post by Corruptsector » Mon Nov 02, 2020 9:15 am

Does anyone have a copy of these files. I got the archive version but its made it a py.l file and it looks like a binary. Sorry if this is a stupid question but does anyone know how to use the archive file at https://bitbucket-archive.softwareherit ... ory.tar.gz

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: MAX31855 Driver

Post by pythoncoder » Mon Nov 02, 2020 9:28 am

I think you've downloaded the wrong file. I can't open this file.

In general under Linux you can just browse to the file with your favourite file manager, double-click on it and it will be opened using archive manager. But it doesn't work for this file which appears empty. I can't answer for Windows or OSX.
Peter Hinch
Index to my micropython libraries.

Corruptsector
Posts: 4
Joined: Mon Nov 02, 2020 9:12 am

Re: MAX31855 Driver

Post by Corruptsector » Mon Nov 02, 2020 9:36 am

Thanks for the quick reply. But if i click on the link provided by deshipu and download the repo, thats the file i get. A tar.gz that when i extact has all sorts of off files in it. I think maybe its a Mercurial thing, but not sure how to get the driver out of that file.

Any help appreciated. It looks like all links to this driver are dead.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: MAX31855 Driver

Post by pythoncoder » Mon Nov 02, 2020 9:42 am

That's a puzzler. I can open other tar.gz files with no problem, but not the one you linked which appears empty.

As for the driver I haven't used it. Hopefully someone who has will chip in.
Peter Hinch
Index to my micropython libraries.

Corruptsector
Posts: 4
Joined: Mon Nov 02, 2020 9:12 am

Re: MAX31855 Driver

Post by Corruptsector » Mon Nov 02, 2020 9:46 am

Thanks Peter. there is a .hg folder which might be hidden in linux.

Then under .hg\store\data there is max31855.py.i but no idea what next.

Post Reply