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:
34:f56962030c5c
Parent:
33:6ea4c3dd504d
Child:
35:95d838d33bf5
--- a/main.cpp	Tue Dec 02 13:55:01 2014 +0000
+++ b/main.cpp	Sat Dec 27 14:37:12 2014 +0000
@@ -16,17 +16,22 @@
     pc.printf("DEVICE_ID register: 0x%X\r\n", dw.getDeviceID());
     pc.printf("EUI register: %016llX\r\n", dw.getEUI());
     pc.printf("Voltage: %f\r\n", dw.getVoltage());
-
-    //r.receiver = true;
+    pc.printf("Size of Frame: %d\r\n", sizeof(r.TX));
+    
+    uint16_t setdelay = 65500;
+    dw.writeRegister16(DW1000_TX_ANTD, 0, setdelay);
+    pc.printf("Antenna Delay TX: %d\r\n", dw.readRegister16(DW1000_TX_ANTD, 0));
+    pc.printf("Antenna Delay RX: %d\r\n", dw.readRegister16(DW1000_LDE_CTRL, 0x1804));
+    r.receiver = true;
     
     bool senderstart = true;
     while(1) {
         for(int j = 0; j < 10; j++)
-            pc.printf("%f ", r.tofs[j]*MMRANGING_TIMEUNIT);
+            pc.printf("%d ", (unsigned int)r.tofs[j]);
         pc.printf("\r\n");
         for(int j = 0; j < 10; j++)
             if(r.event[j][0] == '!') {
-                pc.printf("%s Time: %fus\r\n", r.event[j], r.eventtimes[j]*MMRANGING_TIMEUNIT);
+                pc.printf("%s Time: %lldus\r\n", r.event[j], r.eventtimes[j]);
                 r.event[j][0] = 'X';
             }    
         if (!r.receiver) {