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.

RTOS/CC2650: How do I store 6 bit data efficiently into sensor controller memory?

Part Number: CC2650

Tool/software: TI-RTOS

Hello,

The sensor controller has only four variable types:

  • U16 - 16-bit unsigned integer
  • S16 - 16-bit signed integer
  • U16* - Pointer to a 16-bit unsigned integer variable in RAM
  • S16* - Pointer to a 16-bit signed integer variable in RAM

I am collecting sensor data which is 6 bits. How do I store it efficiently into the RAM of the sensor controller?

  • Roman,

    The sensor controller does not have 8 bit variables or registers. If you are targeting just storage and not doing anything kind of math on the data, then you could create 100 locations of 16 bit unsigned int. Then store two 6 bit values in each int (by bit shifting the odd numbered data up by 8 first.

    Regards,
    /TA
  • Hi,

    What about having pointer access to the start of an array? You can have an array of 16 bit containers. I think arrays are stored together in memory, so if I get a pointer to the first element, can I then just increment by a bit at a time instead of accessing the array using array notation?