I have problem with my spi. Its not give me a constant answer with the same code.
Hello, i try to program my dwm1000. I am new on that. At the first step i send 0x00 to take the ID verification (0xDECA1000) but its not constant at the same value. Some times is 0xDECA1000 with the same code. Some times i take 0xDC8A0330 or something like this.
(i have connected analysizer )
I use spi from stm32L4 series.
My code is:
uint8_t FID = 0x00;
uint8_t data[4];
HAL_Delay(1000);
HAL_GPIO_WritePin(DW_RESET_GPIO_Port, DW_RESET_Pin, GPIO_PIN_SET);
HAL_Delay(100);
HAL_GPIO_WritePin(DW_RESET_GPIO_Port, DW_RESET_Pin, GPIO_PIN_RESET);
HAL_Delay(100);
HAL_GPIO_WritePin(DW_RESET_GPIO_Port, DW_RESET_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(DW_NSS_GPIO_Port, DW_NSS_Pin, GPIO_PIN_RESET );
HAL_SPI_Transmit(&hspi1, &FID, 1, 100);
HAL_SPI_Receive(&hspi1, data, 4, 100);
HAL_GPIO_WritePin(DW_NSS_GPIO_Port, DW_NSS_Pin, GPIO_PIN_SET );
Can anyone help me please?
