|
CC1100如何接收100个以上的字节,是这样的,我的项目要求定点测试一个点的频率,并用CC1100将数据发到服务端,请问CC1100如何接收,发送100个以上的字节,CC1100的FIFO只有64字节,要是分两字接、发的话,要如何去分,小弟不才看不懂英文资料,不过我看过资料上有说过大于64字节的接收的。
原文大概如下,实现看不懂,请朋友们指条明路,接、发、无线唤醒功能都全做好,现在就差如何实现大量数据的接、发而已,希望好心人能教一下,最好有做过大数据接,发的朋友,贴个程序来给小弟看看。谢谢大家
The number of bytes in the RX FIFO can be read from the status register
RXBYTES.NUM_RXBYTES. To avoid receiving data while reading the last byte in the
RX FIFO one should never empty the RX FIFO before the last byte of the packet is
received. Due to issue 3 in this errate note, special care must be taken when reading the
RXBYTES register during reception.:
1. Read RXBYTES.NUM_RXBYTES repeatedly at a rate guaranteed to be at least
twice that of which RF bytes are received until the same value is returned twice; store
value in n.
2. If n < # of bytes remaining in packet, read n-1 bytes from the RX FIFO.
3. Repeat 1-2 until n = # of bytes remaining in packet.
4. Read the remaining bytes from the RX FIFO.
Pseudocode:
BYTE n, l, len, *pDataBuf;
// Get length byte in packet (safely)
n = SPI_READ(RXBYTES);
do { l = n; n = SPI_READ(RX_BYTES); } while (n<2 && n!=l);
*pDataBuf++ = len = SPI_READ(RX_FIFO);
// Copy rest of packet (safely)
while (len>1) {
n = SPI_READ(RXBYTES);
do { l = n; n = SPI_READ(RX_BYTES); } while (n<2 && n!=l);
while (n>1) {
*pDataBuf++ = SPI_READ(RX_FIFO);
len--; n--;
}
}
*pDataBuf++ = SPI_READ(RX_FIFO); |
阿莫论坛20周年了!感谢大家的支持与爱护!!
月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!
|