FAQ: Receiving packets byte by byte?

Q: Is it possible to receive a packet byte by byte? In Raw and Pattern Match modes is it necessary to receive a full packet first?

A: Please have a look at the programming manual’s description of the PKTCHUNKSIZE register as well as the section “FIFO chunk encoding” (pages 70 and 7 respectively). If PKTCHUNKSIZE is set to 0x02 you, then the received packet will be split into chunks of “length 2”, (Actually 3 bytes; 1 byte chunk header, 1 byte flags and 1 byte payload). You can fetch each payload byte separately from the FIFO as it is received.

Please note: The AX-RadioLAB generated code is not prepared for fetching packets split into multiple chunks. Normally the chip will automatically discard e.g. packets which fail the CRC check. This works by the RX only “committing” the FIFO data upon successful CRC check. If you request the bytes as they arrive, you will have to take care yourself about discarding the bytes you already got – The RX can check the CRC only when the last byte has been received.