This is the DW1000 driver and our self developed distance measurement application based on it. We do this as a semester thesis at ETH Zürich under the Automatic Control Laboratory in the Department of electrical engineering.

Dependencies:   mbed

Revision:
23:661a79e56208
Parent:
22:576ee999b004
Child:
24:6f25ba679490
--- a/main.cpp	Thu Nov 27 13:28:18 2014 +0000
+++ b/main.cpp	Thu Nov 27 13:34:35 2014 +0000
@@ -5,9 +5,6 @@
 PC          pc(USBTX, USBRX, 921600);   // USB UART Terminal
 DW1000      dw(PA_7, PA_6, PA_5, PB_6, PB_9);     // SPI1 on Nucleo Board (MOSI, MISO, SCLK, CS, IRQ)
 
-Timer       LocalTimer;                 // debuging timer
-int         old_time = 0;
-
 const float timeunit = 1/(128*499.2e6);
 int i=0;
 char message[1200] = "";
@@ -43,11 +40,10 @@
         pc.printf("%d Sent: \"%s\" %d ", i, messagecheck, strlen(messagecheck)+1);
     else
         pc.printf("%d Sent! %d ", i, strlen(messagecheck)+1);*/
-    pc.printf("SENT!! Status: %010llX Time: %d\r\n", dw.getStatus(), LocalTimer.read_us()-old_time);
+    pc.printf("SENT!! Status: %010llX\r\n", dw.getStatus());
 }
 
 int main() {
-    LocalTimer.start();
     pc.printf("DecaWave 0.1\r\nup and running!\r\n");  
     dw.setEUI(0xFAEDCD01FAEDCD01);                  // basic methods called to check if we have a working SPI connection
     pc.printf("%d DEVICE_ID register: 0x%X\r\n", i, dw.getDeviceID());
@@ -63,13 +59,10 @@
     
     while(1) {
 #if 1
-        //sprintf(message, "Hi %d", i);
-        sprintf(message, "012345678901234567890123456789012345678");
+        sprintf(message, "Hi %d", i);
         if ((i % 10) > 5) {
             dw.sendString(message);
-            old_time = LocalTimer.read_us();
-            dw.writeRegister8(DW1000_SYS_CTRL, 0, 0x02);
-            pc.printf("%d Sent: \"%s\" %d \r\n", i, message, strlen(message)+1);
+            //pc.printf("%d Sent: \"%s\" %d \r\n", i, message, strlen(message)+1);
         }
 #endif
 #if 0