View previous topic :: View next topic |
Author |
Message |
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Wed Jul 15, 2020 12:00 pm Post subject: MAX31856 from -210 °C to 1800 °C step 0,0078125 °C. |
|
|
Hello. I made this some time ago but wait to be tested.
This sensor need 200ms to finish the reading after start conversion so like with DS18B20 (750ms) you can make lazy code that wait for the result or fire it first, do some stuff in the meantime, then back for the result. Its your choice.
I attach semi lazy example because I fire "Start measure", then wait 200ms, then "Read result" with functions that not wait for anyting and they should be handled by some timer or so. But in the "library" routines you can find functions that fired once wait for the result (that hold your program for 200ms).
Some info from "info.txt":
You can choose between three types of SPI: Hard, Soft and Shiftin/Shiftout
Choose must be taken i the "MAX31856_routines.inc" file by setting Const Spi_mode
0 - is for Shiftin/Shiftout. It gives you possibility to use any pin.
1 - is for hardware SPI. You should connect to MOSI(SDI), MISO(SDO), SCK(CLK) and optionally CS pins,
that are dedicated for it in your micro.
2 - is for software SPI and you also can connect/choose any pin for it BUT ONLY! if you not use
hardware SPI on your project (hard and soft SPI`s can`t be configured both together for one micro) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Wed Jul 15, 2020 1:49 pm Post subject: |
|
|
hi EDC
excellent ! Thanks for sharing.
I like the fact that you support various ways like shift, soft and hard spi. And that you can simply include it.
A nice package complete with PDF _________________ Mark |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Wed Jul 15, 2020 6:22 pm Post subject: |
|
|
Hi EDC
Nice work !
Reading a temperature is not easy.
Whatever the sensor is, it is necessary to think that a sensor must be warmed up before asking it to give a result.
It is also necessary to be wary of the environment: infra-red radiation, draught etc... which can interfere and distort the reading. I had a lot of difficulties with sensors of the thermocouple and pt100 probe type.
I see you are also looking for the "right values".
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
mediumdavari
Joined: 15 Sep 2018 Posts: 2
|
Posted: Sun Jul 19, 2020 8:01 am Post subject: |
|
|
Hi Pro man
great job thanks for sharing this code |
|
Back to top |
|
|
|