2020-12-01 08:17 AM
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?
2020-12-01 10:33 AM
How long does it take to come out of reset?
How long does it expect CS/NSS to be low before the clock starts?
I'd probably use HAL_SPI_Transmit_Receive, but that's me..
2020-12-01 05:10 PM
Are you driving RSTn in push-pull or open-drain mode?
RSTn should never be driven high by an external source.
I'd give it at least a few ms after reset before trying to send data.
2020-12-02 01:51 AM
Hello, my RST it was open-drain but i turn to push-pull.
I'd try with a delay after the reset but i take the same behavior.
2020-12-02 01:52 AM
ok thank you, i will try the HAL_SPI_Transmit_Receive!!!