2024-02-03 11:36 PM - last edited on 2024-12-12 03:55 AM by Andrew Neil
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.
Here are my device configuration
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 */
2024-02-04 11:27 AM
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.
2024-02-04 06:08 PM
> 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.