MAX31864 SPI
Moderator: Benj
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
MAX31864 SPI
Hello!!!
Does anyone have any working example of how to read values from the adafruit max31865?
I try to use the spi master but I get nothing in return....I also cannot find any examples to read from an spi sensor in general
Does anyone have any working example of how to read values from the adafruit max31865?
I try to use the spi master but I get nothing in return....I also cannot find any examples to read from an spi sensor in general
- Attachments
-
- temp.fcfx
- (26.2 KiB) Downloaded 319 times
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: MAX31864 SPI
Hi.
For a start when you select Auto CS to "NO"(as you did in your FC chart)
Then you have to control the CS pin yourself in the Flowchart and normally SPI chips need to see a transition from High ---> low to start transmission
as I show you here with your C13 pin, which I assume you use for CS ,if you select auto CS and define the pin the component will do this all automatically for you
Secondly are you sure your controller is running at the correct speed? I looked at your Config settings and they seems strange to me
For a start when you select Auto CS to "NO"(as you did in your FC chart)
Then you have to control the CS pin yourself in the Flowchart and normally SPI chips need to see a transition from High ---> low to start transmission
as I show you here with your C13 pin, which I assume you use for CS ,if you select auto CS and define the pin the component will do this all automatically for you
Secondly are you sure your controller is running at the correct speed? I looked at your Config settings and they seems strange to me
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31864 SPI
Dear Mr QMESAR
Thank you very much for your quick response and your valuable information!! well noted and already tried but nothing the response is FFFF...
I also tried to understand the datasheet, and it looks like there is a register to write configuration sending a byte array and read..
The problem is that I am not familiar with registers and bytes so I ve been trying now for a couple of hours with no result...
It would be nice for flowcode to have it as a sensor because it is so much in use...
Thank you very much for your quick response and your valuable information!! well noted and already tried but nothing the response is FFFF...
I also tried to understand the datasheet, and it looks like there is a register to write configuration sending a byte array and read..
The problem is that I am not familiar with registers and bytes so I ve been trying now for a couple of hours with no result...
It would be nice for flowcode to have it as a sensor because it is so much in use...
- Attachments
-
- temp.fcfx
- (36.45 KiB) Downloaded 272 times
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: MAX31864 SPI
Hi
Yes normally there is some command you should send to read the specific information from the device
post the datasheet that we can see what you need.
It is impossible for Flowcode to support all sensors and chips this one might be for you important then for 1000 people some other chips is important
it is always good to learn to write the correct information yourself
Post the datasheet and we can try to help
Yes normally there is some command you should send to read the specific information from the device
post the datasheet that we can see what you need.
It is impossible for Flowcode to support all sensors and chips this one might be for you important then for 1000 people some other chips is important
it is always good to learn to write the correct information yourself
Post the datasheet and we can try to help
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31864 SPI
Thank you again very much!!!
And yes i totally agree with you!!!if i (or anyone else ) we can learn the fundmentals then it is much better because we can fix anything....So i keep trying maximum effort
attached please find the sensor module and the datasheet!!!
Thank again for your help!!!
And yes i totally agree with you!!!if i (or anyone else ) we can learn the fundmentals then it is much better because we can fix anything....So i keep trying maximum effort

attached please find the sensor module and the datasheet!!!
Thank again for your help!!!
- Attachments
-
- MAX31865.pdf
- (836.12 KiB) Downloaded 340 times
-
- Untitled.png
- (243.36 KiB) Downloaded 1154 times
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31864 SPI
oh and I forgot,
yes, the controller is running perfectly!!
Led flash test 1 sec DONE!
uart comm 115200 baud rate and hello to pc DONE!
All looks well!!
plus I am already interfacing with ethernet and UDP to android etc with same configurations!
I must say that we have no problem there.
My humble opinion is that I need to sent bytes to configure the module and then request bytes to take the measurement.
The problem is I have never worked with bytes arrays and reg addresses before...
Now it is my chance to start learning but every single example I can find is for Arduino and basically they use libraries...so no hint...
yes, the controller is running perfectly!!
Led flash test 1 sec DONE!
uart comm 115200 baud rate and hello to pc DONE!
All looks well!!
plus I am already interfacing with ethernet and UDP to android etc with same configurations!
I must say that we have no problem there.
My humble opinion is that I need to sent bytes to configure the module and then request bytes to take the measurement.
The problem is I have never worked with bytes arrays and reg addresses before...
Now it is my chance to start learning but every single example I can find is for Arduino and basically they use libraries...so no hint...
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: MAX31864 SPI
Hi
I am out the next few days but I am sure there will be some one here that can help you with that .
You are right with thisMy humble opinion is that I need to sent bytes to configure the module and then request bytes to take the measurement.
The problem is I have never worked with bytes arrays and reg addresses before...
I am out the next few days but I am sure there will be some one here that can help you with that .

https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: MAX31864 SPI
Hi,
From the datasheet it looks like you will need to use the TransactionArray()
rather than Get and SendByteArray.
The first byte of the array is to be set to the required address.
If you are writing data, bit 7 is set to 1, i.e. addresses start at 0x80, for reading they start at 0x00
So to read the RTD data from the device set DataOut[0] = 0x01 and Numbytes to 3
Call TransactionArray() and the RTD MSB will be in DataIn[1] and the RTD LSB in DataIn[2]
From the datasheet it looks like you will need to use the TransactionArray()
rather than Get and SendByteArray.
The first byte of the array is to be set to the required address.
If you are writing data, bit 7 is set to 1, i.e. addresses start at 0x80, for reading they start at 0x00
So to read the RTD data from the device set DataOut[0] = 0x01 and Numbytes to 3
Call TransactionArray() and the RTD MSB will be in DataIn[1] and the RTD LSB in DataIn[2]
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31864 SPI
Thank you Leigh for your quick response,
Well i was trying all night yesterday but i got some weard results....
meaning:
The way you proposed (if i understood it correctly)works but....
it is noty stable sometimes i read values msb/lsb sometimes(most of the times 0)...somethink is not appropriate.
I tested with and arduino by the way and the demo code from adafruit and i made it work in 2 minutes!!!!amazing but i cannot understand the structure of their code cause everything in libraries
Well i was trying all night yesterday but i got some weard results....
meaning:
The way you proposed (if i understood it correctly)works but....
it is noty stable sometimes i read values msb/lsb sometimes(most of the times 0)...somethink is not appropriate.
I tested with and arduino by the way and the demo code from adafruit and i made it work in 2 minutes!!!!amazing but i cannot understand the structure of their code cause everything in libraries

- Attachments
-
- temp.fcfx
- (32.63 KiB) Downloaded 295 times
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31864 SPI
ok but if i put auto cs to no it means i will configure an output high and low manually before and after each transaction???
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31864 SPI
ok I tried and after I compiling the first time I took some values to MSB and LSB but after shutdown and open again all 0...
- Attachments
-
- temp.fcfx
- (32.6 KiB) Downloaded 241 times
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31864 SPI
can you send me please a short and quick example of how to write in specific adress?
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: MAX31864 SPI
Hi,
From the datasheet page 18 it shows how to write to a register with a two byte transaction.
So set the register address, e.g. the Config address of 0x80, into DataOut[0] = 0x80
Set the value into DataOut[1]
Then set Numbytes to 2 and call TransactionArray()
The fact that you sometimes get 255 and others 0 implies a problem with the SPI.
Are your voltage levels and clock speed OK?
Could you try the SPI in software mode?
From the datasheet page 18 it shows how to write to a register with a two byte transaction.
So set the register address, e.g. the Config address of 0x80, into DataOut[0] = 0x80
Set the value into DataOut[1]
Then set Numbytes to 2 and call TransactionArray()
The fact that you sometimes get 255 and others 0 implies a problem with the SPI.
Are your voltage levels and clock speed OK?
Could you try the SPI in software mode?
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
Re: MAX31865 SPI
Hello again,
Well after months of trying well I couldn't make it to work..... It looks like it makes me very confused and apparently I cannot understand the datasheet no matter what..... I had to find a workaround so I used an Arduino boot loaded Atmel with adafruit code for the module and talked to my cpu......horrible but worked........any example of any module of just how you make a transaction would be greatly appreciated after that i hope i can use it as guided!!
thank everyone
Well after months of trying well I couldn't make it to work..... It looks like it makes me very confused and apparently I cannot understand the datasheet no matter what..... I had to find a workaround so I used an Arduino boot loaded Atmel with adafruit code for the module and talked to my cpu......horrible but worked........any example of any module of just how you make a transaction would be greatly appreciated after that i hope i can use it as guided!!
thank everyone

-
- Posts: 52
- Joined: Fri Apr 07, 2017 1:55 am
- Location: Greece
- Has thanked: 16 times
- Been thanked: 14 times
Re: MAX31864 SPI
Hi kabouras,
I do have a working example for max31865 but includes LODS of code irrelevant to this sensor.
I will take out all the irrelevant code to the sensor and upload it for you this weekend.
George
I do have a working example for max31865 but includes LODS of code irrelevant to this sensor.
I will take out all the irrelevant code to the sensor and upload it for you this weekend.
George
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
-
- Posts: 52
- Joined: Fri Apr 07, 2017 1:55 am
- Location: Greece
- Has thanked: 16 times
- Been thanked: 14 times
Re: MAX31864 SPI
Hi Jorgen
this is not privet,
I thought it would be better if I cleaned the flowchart from other irrelevant tasks before I upload.
My goal is to declutter the flowchart and make it understandable enough for someone who is familiar with component creation , so he can build a flowcode component with it.
Anyway, here is a sample.
I ll be back during the weekend
George
this is not privet,
I thought it would be better if I cleaned the flowchart from other irrelevant tasks before I upload.
My goal is to declutter the flowchart and make it understandable enough for someone who is familiar with component creation , so he can build a flowcode component with it.
Anyway, here is a sample.
I ll be back during the weekend
George
- Attachments
-
- Max31865.fcfx
- (31.45 KiB) Downloaded 293 times
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times