cancel
Showing results for 
Search instead for 
Did you mean: 

[URGENT] How to read temperature with MAX31855 Thermocouple with STM32 NUCLEO-U5A5ZJQ Board?

purushotham2608
Associate III

Hello everyone, I hope you're all doing well. Recently I have tried to measure temperature using a K-type thermocouple with a breakout board that uses a MAX31855 IC Its sends out 32 bits and my board can read 32 bits SPI. I have wired everything correctly but I am not receiving anything. please provide kind support thank you best regards. Also if anyone knows a way to view/monitor the value using UART with PUTTY terminal please help as I would prefer to use UART to see the values instead of Live Expressions. I am new to STM32  so please excuse me if this question is really silly. Thank You Best Regards.

 

spi_rec_val staying at 0 not changing value even after SPI_Receive in Live expression.

purushotham2608_2-1707031980237.png

 

 

 

 

Here are my device configuration

purushotham2608_1-1707029786848.png

 

 

pin connections :
(Nucleo Board) <-> (MAX31855 Breakout Board)
GPIO_Output_PD14 <-> CS pin
SPI1_MISO (PA6) <-> SO pin
SPI1_SCK (PA1) <-> SCK pin

here is my code

 /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {



	  HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_RESET);
	  HAL_SPI_Receive(&hspi1,(uint8_t*)spi_rec_val, 4, 100);
	  HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_SET);

	  HAL_Delay(1000);
    /* USER CODE END WHILE */




2 REPLIES 2

Your needs and the communities don't align.  http://www.catb.org/~esr/faqs/smart-questions.html#urgent

Pretend it's not an STM32 issue, apply C programming and debugging techniques.

Stick a scope or logic analyzer on the signals, confirm what the device is returning.

If the issue is with the MAX31855, read the manual, and then again.

Check you have it in the right mode, and check the clock vs chip select vs data signals.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

> I am not receiving anything

This is literally not possible with the SPI protocol. There's a signal on the line and the master reads it. Do you mean that you're getting all 0's?

I'd recommend using 4-wire mode and leaving the MOSI pin unconnected. The receive-only master mode can send extra clocks.

 

If you feel a post has answered your question, please click "Accept as Solution".