Interfacing DWM1000 with atmel samL21

Hi,

          I am new to the DWM1000 family, We have brought the UWB1000 module interface with SAML21J18B Atmel microcontroller, I need to know what are the basic configuration settings initially? (dwt_configure(&config);) I tried using basic TX and RX, where TX is happening and RX is not receiving any packets. what have I missed? **RXFDD** bits are getting set. when I checked the status reg bit I am getting **0x8000027f**. Please help.

         What all bits to be set in initialization?
         What is the configuration settings?
         What are the basics for TX RX communication?
         if RXFDD bit is getting set why RXFCG is not getting set?
         how to switch between ANCHOR and TAG?

Thanks in advance.

Hi
It not easy to pinpoint what the problem is. (RXFDD bit?)
I take it you have a DWM1000.
What example code API are you using ? Because the simple examples do have the initialisation settings.
For furter details on configuration settings see usermanual section 2.5 .
Regards
Leo

Thanks.

I am using examples provided in decawave website, using 5a and 5b for twr. Now we are able to transmit data but receive is not happening.

Hi,
Do you see any errors when you read teh RX state/Status?
See APS022 attached
APS022_Debugging_DW1000_based_products_systems_v1.3.pdf (721.0 KB)
Leo

Hi Leo,

gone through the document APS022 thanks, before RX, i have doubts about my SPI communication. My SPI clock is at 8MHz, I am able to read the Device ID 0xDECA0130, but, when I try to read the PANADR register I get 0x345678FF Instead of 0x12345678.

uint32 var = 0x12345678;

dwt_write32bitreg(PANADR_ID,var);
rxvar = dwt_read32bitreg(PANADR_ID);

Below is my SPI Read Function

bool spi_read_pio(uint8* header,uint16 headerlen,uint8* pu8Miso, uint16 u16Sz)
{
uint16_t txd_data = 0;
uint16_t rxd_data = 0;
uint8_t *hptr = header;

spi_select_slave(&spi_dwm1000_master, &slave_dwm100_inst, true);

while (headerlen--) {
	txd_data = (uint16_t)*hptr++;
	while (!spi_is_ready_to_write(&spi_dwm1000_master))
	;
	while(spi_write(&spi_dwm1000_master, txd_data) != STATUS_OK)
	;

}
/* Read SPI master data register. */
while (!spi_is_ready_to_read(&spi_dwm1000_master))
;
while (spi_read(&spi_dwm1000_master, &rxd_data) != STATUS_OK)
;
rxd_data = 0;

while(u16Sz)
{
	//rxd_data = (uint16_t)spi_dwm1000_master.hw->SPI.DATA.reg;
	txd_data = 0;
	while (!spi_is_ready_to_write(&spi_dwm1000_master))
	;
	while(spi_write(&spi_dwm1000_master, txd_data) != STATUS_OK)
	;
	delay_us(100);
	/* Read SPI master data register. */
	while (!spi_is_ready_to_read(&spi_dwm1000_master))
	;
	while (spi_read(&spi_dwm1000_master, &rxd_data) != STATUS_OK)
	;
	*pu8Miso = rxd_data;
	
	u16Sz--;
	if (!u8SkipMiso)
	pu8Miso++;
}

while (!spi_is_write_complete(&spi_dwm1000_master))
;
spi_select_slave(&spi_dwm1000_master, &slave_dwm100_inst, false);
return true;

}

Thanks.