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.

LAUNCHXL-CC2650: How do I use the HAL_ADC?

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: REMOTI, CC2650

Hi, I am working with RemoTI on a CC2650 Launchpad. I am trying to implement an ADC and I know about the HAL_ADC, but I don't know how to use it. I was looking at the HAL API, but the functions it describes in there (such as HalAdcInit), I can't find in the CC2650 RemoTI stack. Is there a way I can use the HAL_ADC on the CC2650 Launchpad?

Thanks

  • Hi Miles,

    One easy way to do this would be to utilize the Sensor Controller. The Sensor Controller Studio has a project that uses the ADC. It collects samples in a 128 bytes circular buffer. You could update this example to generate an interrupt to the CM3 when the buffer is full. It would then automatically create another buffer to continue sampling, while the CM3 processes the full buffer.

    The required additional lines of code would be, based on the ADC Data Logger project:

    "...

    // Disable the ADC
    adcDisable();

    // Generate interrupt and hand over buffer when full
    if (output.head == 0) {
       // output.head will be 1 on first run, at this point it will only be 0 when buffer is full
       fwSwitchOutputBuffer();
    }

    // Schedule the next execution
    fwScheduleTask(1);

    ..."

    Note that you must enable Multi-Buffered Output Data Exchange. Simply check the box in the Task Resources pane:

  • Can I use that with the RemoTI stack on the same CC2650 Launchpad? I need the wireless communication protocol running with an ADC. Thanks
  • Yes, RemoTI runs on CC2650 LaunchPad