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.

CCS/CC2650: I am looking into linking three sensors to the processor, running them all through separate adc's and then sending the data that is read in through a csv file to an apple bluetooth device for a design project.

Part Number: CC2650

Tool/software: Code Composer Studio

I originally began by modifying the adc single channel example code to operate with each of the three sensors, then I added code to adjust the sensor readings into a usable format for the item that was detected. I tried to debug this and it seemed that the adc was not correctly configured, but the code compiled without issue. I used the array called adcValueX[i], where X is the adc channel, to increment through and find the highest reading for each sensor. I will include one of the tasks that I used for reading the adc below:

Void taskFxn1(UArg arg0, UArg arg1)
{
uint16_t i;
ADC_Handle adc;
ADC_Params params;
int_fast16_t res;

ADC_Params_init(&params);
adc = ADC_open(Board_ADC1, &params);

if (adc == NULL) {
System_abort("Error initializing ADC channel 1\n");
}
else {
System_printf("ADC channel 1 initialized\n");
}

for (i = 0; i < ADC_SAMPLE_COUNT; i++) {
res = ADC_convert(adc, &adcValue1[i]);

if (res == ADC_STATUS_SUCCESS) {
System_printf("ADC channel 1 convert result (%d): 0x%x\n", i,
adcValue1[i]);
}
else {
System_printf("ADC channel 1 convert failed (%d)\n", i);
}

System_flush();
}

ADC_close(adc);
}

Since that didn't output properly I tried using sensor controller studio and I created the proper code, but I ran into compiler issues here and I could not figure out how to implement Bluetooth using the controller studio. I have tried to compile both of these with the BLE stack, but none of them seem to work. I have set up a simple way to generate a csv file but I am unable to transmit this without the peripheral Bluetooth configuration. I have tried to find the base code for Project Zero, but it seems as though it is no longer available even though the flash program for it seems to make the device discover able.

Any help would be greatly appreciated!

  • Hello Matt,

    The ADC code looks ok, what exactly are you reading? The output of this will be the voltage you are reading directly from the sensor. You will need to convert to the units you are trying to read.
  • I am reading three environmental sensors that change their voltage based on concentration of pollutants (two of the sensors read a higher voltage when a higher concentration is detected and one creates a temporary low voltage when a particle passes by the sensor, I have more specific code to implement these, but that should not effect the adc configuration). I have been trying to debug the code by manually changing the adc ports using a power supply to a higher voltage, but the reading does not seem to show up as anything higher than 0 in the debugger. I am also trying to figure out a way to set up my device to act like a peripheral for an iPhone, but I have been unable to use the Bluetooth stack to any real success.
  • Hello,

    What do you have configured on your ADC section inside your CC2650_LAUNCHXL.c?

    As for the BLE question please open a new thread so the BLE experts can help you with it.

    Regards,
    AB
  • Hello,
    Any updates on the ADC issue?
    Regards,
    AB
  • Hello Matt,

    I'm closing this thread due to inactivity. Please free to reopen this thread by replying.

    Regards,
    AB