0

MAX31865-Adafruit code
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MAX31865-Adafruit code

by Silmar on Mon Jan 29, 2018 7:44 pm

Hi all,

I am new in Arduino environment. I just bought one of the MAX31865 to connect with my arduino.
The libraries and examples provided in the web are ok but I would like to write my own code from scratch.

From what I see on the schematics, the chip requires CLK, SDO, SDI and CS connected to the PWM pins. Where CLK, SDI and CS are input and SDO is output.

I am taking a look into the library but is not clear to me how do I select the 3W mode what information I am suppose to be giving to the other pins.
Can anyone give some help, or some reference to look at?

Thanks

Silmar
 
Posts: 2
Joined: Mon Jan 29, 2018 6:59 pm

Re: MAX31865-Adafruit code

by zener on Mon Jan 29, 2018 8:37 pm

That device uses SPI. Usually people just use an existing SPI library, rather than reinventing the wheel. There are a couple of ways to do SPI however, and there are libraries for each. One way uses dedicated SPI hardware inside the microcontroller. The other uses GPIO pins to do the SPI communication in software. It sounds like you are interested in the latter approach, so I would look at software SPI routines to see how they are doing it. You can also research SPI itself to understand the general timing requirements.

zener
 
Posts: 4368
Joined: Sat Feb 21, 2009 2:38 am

Re: MAX31865-Adafruit code

by Silmar on Tue Jan 30, 2018 12:08 am

Actually, I am trying to convert the Arduino code to labview.
I decided to use LINX, since it is a labview free library to control Arduino. It offers SPI configuration.

Looking on different specifications sheets, I found the appropriate configuration for the channels.
SPI mode = 0
50kHz to 60kHz
The data read is from Msb to Lsb

Whereas the SDO is the output and I am assuming that It will deliver some data, I am still not sure about the input information for the channels.
For instance, on the specifications one can read:
CS Active-Low Chip Select. Set CS low to enable the serial interface.

Shall I send a zero to initialize the interface or it is already initialized once powered the device?

SCLK Serial-Data Clock Input

Shall i give a value? Or it is taken once I configure each channel individually?

SDI serial data input

Does it require any input from my side? The library from adafruit does not seem to use this channel.

Thanks for the help

Silmar
 
Posts: 2
Joined: Mon Jan 29, 2018 6:59 pm

Re: MAX31865-Adafruit code

by amine007 on Thu Feb 07, 2019 5:05 am

can u share the LabVIEW max31865 code plz ?

amine007
 
Posts: 1
Joined: Thu Feb 07, 2019 5:02 am

Re: MAX31865-Adafruit code

by adafruit_support_bill on Thu Feb 07, 2019 7:00 am

CS Active-Low Chip Select. Set CS low to enable the serial interface.

Shall I send a zero to initialize the interface or it is already initialized once powered the device?

You need to pull it LOW when you want to communicate with the device.
SCLK Serial-Data Clock Input

Shall i give a value? Or it is taken once I configure each channel individually?

You need to pulse that LOW for every bit that you read from or write to the device.
SDI serial data input

Does it require any input from my side? The library from adafruit does not seem to use this channel.

Yes. You need to have pulled CS LOW and clocked out your command before you can clock in the result.

If you really want to implement an SPI interface from scratch, you really need to become familiar with what SPI is all about and how it works..
https://en.wikipedia.org/wiki/Serial_Pe ... _Interface
https://www.corelis.com/education/tutor ... -tutorial/

adafruit_support_bill
 
Posts: 71777
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.