cancel
Showing results for 
Search instead for 
Did you mean: 

wrong data on SPI data register

Kolab
Senior

I am trying to send 16bits through spi3 of stm32f205rct6. The problem is that the data in my array differs from the data in SPI3->DR.

uint8_t config_data[2]={0xD2,0x8B};  // 1 101 001 0 100 0 1 01 1

uint8_t rx_data[2]={0};

 while (1)

 {

HAL_GPIO_WritePin(GPIOA,GPIO_PIN_15,GPIO_PIN_RESET); // ss

HAL_Delay(10);

HAL_SPI_TransmitReceive(&hspi3,config_data,rx_data,2,10);

HAL_GPIO_WritePin(GPIOA,GPIO_PIN_15,GPIO_PIN_SET);

}

0693W00000DmZabQAF.pngI expected D28B in DR. What is wrong?

3 REPLIES 3

It's NOT a MEMORY, its TWO PERIPHERAL REGISTERS, the outbound is what you SEND, the inbound is what clocks back from the device on the SPI BUS

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

I am receiving wrong data from my sensor and I woud like soomehow to check if the data is sent correctly to the sensor. I don't have a logic analyzor.

Kolab
Senior

and what about the transmission? am I sending the 16bits correctly?I configured the Data Size on Cube as 16bits