How to connect DWM1001-DEV to Arduino?

Hi Saenz,
glad to be of some help.
Just to better understand how to move on, I’d like to know something about you. Are you a student, a newbee, a teacher?
Where are you from? Spain? What College are you in?
I’m and old engineer from the '50, and started workning with Intel 8080 in Assembler. Fortunately or not, I remained linked (limited) to some basic programming but enough to work and play even with state-of-the-art micros.
So ask about interrupts, debugging and Timers but not about Objects and complex development systems.
Arduino is very usefull to avoid soldering but the worse for debugging and understanding your mistalkes.

Anyway, to answer your question: YES…but…there is always a but :wink:
here below a peace of my code: (I hope you can understand comments in italian)

**************** I have two DWM, one HC-05 and the Seria (USB)

// Apre canale verso TAG 1
SerialD.begin(115200);
Serial.println(“aperta comunicazione canale Destro”);

// Apre canale verso TAG 2

//Apre canale verso HC-05

// pulisce Buffer ricezione

resDWM_D:

************* First key point: be sure to start from a known condition
************* Then RESET the DWM and allow time to restart

// Invia comando reset ai TAGs per asicurare condizione di inizio
Serial.println(“invio comandi di reset”);
SerialD.print(“reset\r”);
SerialS.print(“reset\r”);
// dly 500 msec
Tout = millis()+500;
while(Tout>millis());

***** Remember RPI runs Linux which is a multitasking OS Arduino doesn’t.
*************** Avoid delay() use the two lines above instead
********** this is required to leave the communication running.
********** Communication is managed by the interrupts

// pulizia buffer COM stringhe ricezione
RxDflush();
RxSflush();
Serial.println(“Pulizia canali comunicazione”);
******** I clean the rx buffers…just in case…

//************ inizializza sensore Destro
// Per un secondo scarta ogni rispostada canale Destro
Tout = millis()+1000;
while(millis()<Tout){

******* If something arrives in the first second, is spurious…throw away
if (SerialD.available()){
SerialD.readBytes (&B_RXLineD[0],1);
}
}

**** here I notify myself that I’m issuing the command to switch to SHELL MODE

Serial.println(“invio comandi di SHELL MODE”);

*******and send the command to DWM

// put cD in Shell Mode
SerialD.print("\r\r");

****** then I allow 1.5 seconds for the DWM to change mode of operation,
print the messages, print the prompt (dwm>) and be ready to work

// aspetta di vedere il prompt nel buffer di ricez
count = 0;
strcpy(B_RXLineD,"");
Tout = millis() +1500;
while(millis()<Tout){
if (SerialD.available()){
buf = SerialD.read();
if (buf == ‘>’) break;
}
}

****** notify myself…

Serial.print("BufD ");Serial.println(byte(buf));
if(buf == ‘>’)
Serial.println(“Conferma prompt canale Destro”);
else{
Serial.println(“NESSUNA Conferma prompt canale Destro”);
SerialHC.println(“NESSUNA Conferma prompt canale Destro”);
goto resDWM_D;
******* and confirm it is OK or retry the whole process.

Well, I hope it’s clear; there is a lot to learn when you will be able to have the DWM in your hands.
A last suggestion: make large use of the USB connection to familiarize with dwm :wink:

Esperanto