51uwb.cn
标题:
关于DWM1000 发送多个数据的问题
[打印本页]
作者:
wshfxy
时间:
2021-10-14 18:53
标题:
关于DWM1000 发送多个数据的问题
今天在调试DWM1000的时候,发现一个问题,发现发送29个以下的数据能正常接收,但是数据超过30个,接收方就接收不到数据了,很奇怪,不知道大家遇到这个问题没有?
DW1000的配置如下
:
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. */
};
发送源码:
dwt_writetxdata(sizeof(hujiao_tag_allmsg), hujiao_tag_allmsg, 0);
dwt_writetxfctrl(sizeof(hujiao_tag_allmsg), 0);
dwt_starttx(DWT_START_TX_IMMEDIATE);
while (!(dwt_read32bitreg(SYS_STATUS_ID) & SYS_STATUS_TXFRS))
{
};
RFRLED = !RFRLED ;
dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_TXFRS);
接收源码:
dwt_setrxtimeout(15000);
dwt_rxenable(0);
for( i = 0 ; i < RX_BUF_LEN ; i ++)
{
rx_buffer
= 0;
}
status = 0 ;
while (!((status = dwt_read32bitreg(SYS_STATUS_ID)) & (SYS_STATUS_RXFCG | SYS_STATUS_ALL_RX_ERR)))
{
};
if (status & SYS_STATUS_RXFCG)
{
frame_len = dwt_read32bitreg(RX_FINFO_ID) & RX_FINFO_RXFL_MASK_1023;
if (frame_len <= RX_BUF_LEN)
{
dwt_readrxdata(rx_buffer, frame_len, 0);
}
dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_RXFCG);
}
欢迎光临 51uwb.cn (http://51uwb.cn/)
Powered by Discuz! X3.3