From cd37e4ce22e7d61e5cfd9ff88fca38eaeab5e363 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期六, 15 九月 2018 20:02:23 +0800 Subject: [PATCH] 改成快速通讯参数 --- 源码/核心板/Src/OnChipDevices/Spi.h | 2 +- 源码/核心板/Src/main.c | 4 ++-- 源码/核心板/Src/application/dw_app.c | 31 +++++++++++++++---------------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Spi.h" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Spi.h" index 59081e3..f65cb8e 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Spi.h" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Spi.h" @@ -5,7 +5,7 @@ #include "stm32f10x.h" #define SPIx_PRESCALER_SLOW SPI_BaudRatePrescaler_32 -#define SPIx_PRESCALER_FAST SPI_BaudRatePrescaler_16 +#define SPIx_PRESCALER_FAST SPI_BaudRatePrescaler_4 #define SPIx SPI1 #define SPIx_GPIO GPIOA diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" index d82f45e..6c4cdb1 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" @@ -47,13 +47,13 @@ #define POLL_TX_TO_RESP_RX_DLY_UUS 150 /* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the * frame length of approximately 2.66 ms with above configuration. */ -#define RESP_RX_TO_FINAL_TX_DLY_UUS 5100 +#define RESP_RX_TO_FINAL_TX_DLY_UUS 1500 /* Receive response timeout. See NOTE 5 below. */ -#define RESP_RX_TIMEOUT_UUS 14700 +#define RESP_RX_TIMEOUT_UUS 2700 -#define POLL_RX_TO_RESP_TX_DLY_UUS 3600 +#define POLL_RX_TO_RESP_TX_DLY_UUS 420 /* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */ -#define RESP_TX_TO_FINAL_RX_DLY_UUS 1500 +#define RESP_TX_TO_FINAL_RX_DLY_UUS 200 /* Receive final timeout. See NOTE 5 below. */ #define FINAL_RX_TIMEOUT_UUS 4300 @@ -76,18 +76,17 @@ /*------------------------------------ Variables ------------------------------------------*/ /* Default communication configuration. We use here EVK1000's default mode (mode 3). */ -static dwt_config_t config = -{ - 2, /* Channel number. */ - DWT_PRF_64M, /* Pulse repetition frequency. */ - DWT_PLEN_1024, /* Preamble length. */ - DWT_PAC32, /* Preamble acquisition chunk size. Used in RX only. */ - 9, /* TX preamble code. Used in TX only. */ - 9, /* RX preamble code. Used in RX only. */ - 1, /* Use non-standard SFD (Boolean) */ - DWT_BR_110K, /* Data rate. */ - DWT_PHRMODE_STD, /* PHY header mode. */ - (1025 + 64 - 32) /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */ +static dwt_config_t config = { + 5, /* Channel number. */ + DWT_PRF_64M, /* Pulse repetition frequency. */ + DWT_PLEN_128, /* Preamble length. */ + DWT_PAC8, /* Preamble acquisition chunk size. Used in RX only. */ + 9, /* TX preamble code. Used in TX only. */ + 9, /* RX preamble code. Used in RX only. */ + 0, /* Use non-standard SFD (Boolean) */ + DWT_BR_6M8, /* Data rate. */ + DWT_PHRMODE_STD, /* PHY header mode. */ + (129 + 8 - 8) /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */ }; /* Frames used in the ranging process. See NOTE 2 below. */ diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" index b2dd27c..d271c2c 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" @@ -11,8 +11,8 @@ #include "serial_at_cmd_app.h" #include "deca_device_api.h" -//#define WORK_MODE_TAG -#define WORK_MODE_ANCHOR +#define WORK_MODE_TAG +//#define WORK_MODE_ANCHOR #define START_ALARM_DIST_CM 200 #define BEEM_ON_TIME_MS 200 -- Gitblit v1.9.3