This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1200: easy link Tx/Rx packet length

Part Number: CC1200

* Example application - CC120x Easy Link Tx / Rx (from CC120x Software Examples)

When Tx 3 bytes user data (0x0a 0x0b 0x0c) with packet length "0x03" at first byte, (0x03 0x0a 0x0b 0x0c), RX shows below data.

   - Tx: 0x03  0x0a  0x0b  0x0c

   - Rx: 0x06  0x03  0x0a  0x0b  0x0c  0x?? 0x08

The question is about the first "0x06" of Rx buffer.

* What "0x06" means? Who added the byte?

* If "0x06" means the packet length, why data length "0x03" is required?

Best regards,

Hayden

  • Looking at the code for CC120x_ easy_link_tx.c:

    static void createPacket(uint8 txBuffer[]) { txBuffer[0] = PKTLEN; // Length byte txBuffer[1] = (uint8) (packetCounter >> 8); // MSB of packetCounter txBuffer[2] = (uint8) packetCounter; // LSB of packetCounter // Fill rest of buffer with random bytes for(uint8 i = 3; i < (PKTLEN + 1); i++) { txBuffer[i] = (uint8)rand(); } }

    So on the Rx side you will see a 2 byte packet counter + 3 byte payload. 

  • Hi TER,

    Here is more information about the test.
    At the test, "createPacket" was modified just to send user data of three bytes, "0x0a 0x0b 0x0c".
    So, txBuffer[0] = 0x03, and txBuffer[1] ~ txBuffer[3] are "0x0a 0x0b 0x0c".
    There was no application code of adding the first byte of RX buffer, "0x06".
    The question is about "0x06".


    Thanks and regards,
    Hayden
  • You didn't indicate that you had modified the code. Could you post the modified code so I can test it at my side?
  • Sorry for the missing indication.
    I will update about the test code later.

    Thanks and regards,
    Hayden
  • TER,

    Here is the Tx test, packet generation code.

    ---------------------------------------------------------------------------------------
    #define WPT_CC120x_Tx_Buffer_Size 128

    typedef struct
    {
    uint8_t Tx_Buffer[WPT_CC120x_Tx_Buffer_Size];
    } WPT_CC120x_COMMAND_TYPE;

    WPT_CC120x_COMMAND_TYPE WPT_CC120x_Command;

    /* Construct Tx_Buffer to be sent */
    WPT_CC120x_Command.Tx_Buffer[0] = 0x03;//Length Field
    WPT_CC120x_Command.Tx_Buffer[1] = 0x00;
    WPT_CC120x_Command.Tx_Buffer[2] = 0x00;
    WPT_CC120x_Command.Tx_Buffer[3] = 0x01;//Command_Value

    cc120xSpiWriteTxFifo(WPT_CC120x_Command.Tx_Buffer,4);// Write packet to TX FIFO
    trxSpiCmdStrobe(CC120X_STX); // Strobe TX to send packet
    ---------------------------------------------------------------------------------------

    With above Tx (0x03 0x00 0x00 0x01), Rx buffer memory showed as below.

    "0x06 0x03 0x00 0x00 0x01 0x?? 0x80"

    So, the question is what is the meaning of "0x06", the first byte of Rx buffer.


    Thanks and regards,
    Hayden
  • How do you read out the Rx buffer?

    Have you set up the radio to send 802.15.4g packets? In this case it will be a byte before the length byte.

    Have you tried to use SmartRF Studio for the Rx unit and see if you see the same there?
  • Hi TER,

    With RX application, same TX data was received properly.
    ("0x06" was shown at the Rx buffer.)

    Best regards,
    Hayden