Skip to main content
September 8, 2021
Question

wrong data on SPI data register

  • September 8, 2021
  • 3 replies
  • 862 views

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?

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
September 8, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
September 8, 2021

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.

September 8, 2021

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