2021-09-08 08:10 AM
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);
}
I expected D28B in DR. What is wrong?
2021-09-08 08:24 AM
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
2021-09-08 02:07 PM
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.
2021-09-08 02:11 PM
and what about the transmission? am I sending the 16bits correctly?I configured the Data Size on Cube as 16bits