11.07.2015 Views

Clike here to get datasheet of CC1101 - Elechouse

Clike here to get datasheet of CC1101 - Elechouse

Clike here to get datasheet of CC1101 - Elechouse

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CC1101</strong>FIFO is read over the SPI interface, the RXFIFO pointer is not properly updated and thelast read byte is duplicated. To avoid thisproblem one should never empty the RX FIFObefore the last byte <strong>of</strong> the packet is received.For packet lengths less than 64 bytes it isrecommended <strong>to</strong> wait until the completepacket has been received before reading it ou<strong>to</strong>f the RX FIFO.If the packet length is larger than 64 bytes theMCU must determine how many bytes can beread from the RX FIFO(RXBYTES.NUM_RXBYTES-1) and the followings<strong>of</strong>tware routine can be used:1. Read RXBYTES.NUM_RXBYTESrepeatedly at a rate guaranteed <strong>to</strong> be atleast twice that <strong>of</strong> which RF bytes arereceived until the same value is returnedtwice; s<strong>to</strong>re value in n.2. If n < # <strong>of</strong> bytes remaining in packet, readn-1 bytes from the RX FIFO.3. Repeat steps 1 and 2 until n = # <strong>of</strong> bytesremaining in packet.4. Read the remaining bytes from the RXFIFO.The 4-bit FIFOTHR.FIFO_THR setting is used<strong>to</strong> program threshold points in the FIFOs.Table 29 lists the 16 FIFO_THR settings andthe corresponding thresholds for the RX andTX FIFOs. The threshold value is coded inopposite directions for the RX FIFO and TXFIFO. This gives equal margin <strong>to</strong> the overflowand underflow conditions when the thresholdis reached.A signal will assert when the number <strong>of</strong> bytesin the FIFO is equal <strong>to</strong> or higher than theprogrammed threshold. This signal can beviewed on the GDO pins (see Table 33 onpage 56).Figure 21 shows the number <strong>of</strong> bytes in boththe RX FIFO and TX FIFO when the thresholdsignal <strong>to</strong>ggles, in the case <strong>of</strong> FIFO_THR=13.Figure 20 shows the signal as the respectiveFIFO is filled above the threshold, and thendrained below.NUM_RXBYTESGDONUM_TXBYTESGDO53 54 55 56 57 56 55 54 536 7 8 9 10 9 8 7 6Figure 20: FIFO_THR=13 vs. Number <strong>of</strong>Bytes in FIFO (GDOx_CFG=0x00 in RX andGDOx_CFG=0x02 in TX)FIFO_THR Bytes in TX FIFO Bytes in RX FIFO0 (0000) 61 41 (0001) 57 82 (0010) 53 123 (0011) 49 164 (0100) 45 205 (0101) 41 246 (0110) 37 287 (0111) 33 328 (1000) 29 369 (1001) 25 4010 (1010) 21 4411 (1011) 17 4812 (1100) 13 5213 (1101) 9 5614 (1110) 5 6015 (1111) 1 64Table 29: FIFO_THR Settings and theCorresponding FIFO Thresholds56 bytesOverflowmarginFIFO_THR=13FIFO_THR=13Underflowmargin8 bytesRXFIFOTXFIFOFigure 21: Example <strong>of</strong> FIFOs at ThresholdSWRS061C Page 47 <strong>of</strong> 94

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!