SWRA571B August   2017  – August 2020 CC1310 , CC1310 , CC1312PSIP , CC1312PSIP , CC1312R , CC1312R , CC1314R10 , CC1314R10 , CC1350 , CC1350 , CC1352P , CC1352P , CC1352P7 , CC1352P7 , CC1352R , CC1352R

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
  4. 2IQ Dump Patch
    1. 2.1 Recommended Operating Limits
      1. 2.1.1 Register Overrides
      2. 2.1.2 API Configuration
  5. 3Building a Software Example
  6. 4Testing the Patch Using the Built-In Test Pattern
  7. 5References
  8. 6Revision History

Testing the Patch Using the Built-In Test Pattern

To test that the data entries are set up correctly and that the patch is working you can enable the built-in test pattern (see Table 2-2) and declare two arrays (iSamples and qSamples) that can hold the “received” I and Q samples.

#define NUMBER_OF_BUFFERS 5
static uint16_t iSamples[NUMBER_OF_SAMPLE_PAIRS*NUMBER_OF_BUFFERS];
static uint16_t qSamples[NUMBER_OF_SAMPLE_PAIRS*NUMBER_OF_BUFFERS];

For test purposes, set NUMBER_OF_SAMPLE_PAIRS to a low number(2) to easier be able to go through the array to see that everything is OK.

#define NUMBER_OF_SAMPLE_PAIRS 8

In the callback, where code for handling the samples should be implemented, the following code was added:

static uint16_t index = 0;
void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
    if (e & RF_EventRxEntryDone)
    {
        // Toggle pin to indicate RX
        PIN_setOutputValue(ledPinHandle,
                           Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
        // Get a pointer to the first IQ sample byte
        packetDataPointer = &currentReadEntry->rxData;
        //---------------------------------------------------------------------------
        // Implement code for handling the IQ data
        // In this example, I and Q data are simply copied into two separate array
        {
            uint16_t i;
            // IQ Sample Handling
            for (i = index; i < (NUMBER_OF_SAMPLE_PAIRS + index); i++)
            {
                iSamples[i] = (((*(packetDataPointer + 1)) << 8) |
                                (*packetDataPointer)) & 0x0FFF;
                qSamples[i] = (((*(packetDataPointer + 2)) << 8) |
                                (*(packetDataPointer + 1))) >> 4;
                packetDataPointer += 3;
            }
        }
        index += NUMBER_OF_SAMPLE_PAIRS;
        if (index == (NUMBER_OF_SAMPLE_PAIRS*NUMBER_OF_BUFFERS))
        {
            index = 0;
        }
        //---------------------------------------------------------------------------
        currentReadEntry->status = DATA_ENTRY_PENDING;
        currentReadEntry = (rfc_dataEntryPartial_t*)currentReadEntry->pNextEntry;
    }
}

Figure 4-1 shows the five buffers with eight IQ sample pairs in each stored in an iSamples and qSamples array, each holding 40 samples (NUMBER_OF_BUFFERS · NUMBER_OF_SAMPLE_PAIRS).

GUID-75539486-A650-4DE5-990F-C5FF1D8A20B1-low.png Figure 4-1 Built-In Test Pattern Stored as I and Q Samples
In this example, NUMBER_OF_SAMPLE_PAIRS cannot be set lower than 8, as this will make the data entry overflow (RF_cmdPropRx.status = PROP_ERROR_RXOVF)