Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Help with MAX31865 programming
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Help with MAX31865 programming

by lefs on Wed May 20, 2020 6:52 pm

Greetings

I have an Adafruit MAX31865 board and a STM32F750 board. I have tried to get the Maxim chip to work without succes. Can you tell what to write there. Or any other tricks to try.
Now I get only FFh from the chip. I have tried various ways to set up SPI bus and STM software and FFh is the best I can get.

Maxim chip uses SPI bus and atleast CPU sends something to chip. I can see it on scope.
This is the setup data
txBuffer[0] = 0x80; //address
txBuffer[1]=0xC3; //data
txBuffer[2] = 0x83;
txBuffer[3]=0xff;
txBuffer[4] = 0x84;
txBuffer[5]=0xff;
txBuffer[6] = 0x85;
txBuffer[7]=0x00;
txBuffer[8] = 0x86;
txBuffer[9]=0x00;

HAL_SPI_TransmitReceive (&hspi1, txBuffer, rxBuffer, 8, 1000);
RX buffer is full of FFh after this.

Regards
Leif M

lefs
 
Posts: 23
Joined: Mon Jul 30, 2018 10:00 am

Re: Help with MAX31865 programming

by lefs on Wed May 20, 2020 7:38 pm

There is definitely is something wrong in the setup. The Bias voltage 2V is missing from the Reference resistor.

lefs
 
Posts: 23
Joined: Mon Jul 30, 2018 10:00 am

Re: Help with MAX31865 programming

by lefs on Thu Jul 02, 2020 2:26 pm

This is late but I want to report to all you that Adafruit Max31865 work and work with STM32H750 board, too.
I had to read the datasheet very well. Last thing to fix was a missing lead and get my formulas correct. In this version, I drive GPIO pin directly.

Like this:
CS low
Write 0x80 and 0x83
CS up.

CS low
Write 0x80 and 0xc3
CS up

repeat
CS down
you can read temperature data now
cs up

i used small delay between before I made cs active.


My variable names are in Finnish, so they wont tell you a lot. I'll put only a fragment here of my clumsy C code.
Code: Select all | TOGGLE FULL SIZE
....
char msg[40];
int lamp1,lamp2;
double lampf, lampf2;
...
...
 lamp1=rxBuffer[2]*256;  //MSB
 lamp1=lamp1+(rxBuffer[3]);  //LSB
 lamp1=lamp1/2; //0bitti can be deleted, that is, an error indicator
 lampf=lamp1;
 lampf2=lamp1;
 lampf=lampf*430/32768;  //Rrtd page 19
strcpy(msg, "");
sprintf(msg ,"PT100 Resistanssi %f4.0 \n\r",lampf);   
HAL_UART_Transmit(&huart1, (uint8_t*)msg, strlen(msg), 1000);   
strcpy(msg, "");
lampf=((lampf/100.0)-1.0)/(0.003851);
sprintf(msg ,"lampotila Celsius %f4.0 \n\r",lampf);   
HAL_UART_Transmit(&huart1, (uint8_t*)msg, strlen(msg), 1000);   
strcpy(msg, "");
HAL_GPIO_WritePin(GPIOE,GPIO_PIN_3,GPIO_PIN_SET);   //cs 1
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_5,GPIO_PIN_SET);//clk 1
HAL_Delay(5);
}

lefs
 
Posts: 23
Joined: Mon Jul 30, 2018 10:00 am

Please be positive and constructive with your questions and comments.