Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

MAX31856 from -210 C to 1800 C step 0,0078125 C.

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 694

poland.gif
PostPosted: Wed Jul 15, 2020 12:00 pm    Post subject: MAX31856 from -210 C to 1800 C step 0,0078125 C. Reply with quote

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
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5070
Location: Holland

blank.gif
PostPosted: Wed Jul 15, 2020 1:49 pm    Post subject: Reply with quote

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 Very Happy

_________________
Mark
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 938
Location: France

france.gif
PostPosted: Wed Jul 15, 2020 6:22 pm    Post subject: Reply with quote

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".
Wink
JP

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
mediumdavari

Bascom Member



Joined: 15 Sep 2018
Posts: 2

blank.gif
PostPosted: Sun Jul 19, 2020 8:01 am    Post subject: Reply with quote

Hi Pro man
great job thanks for sharing this code
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum