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.

CC1310 : Sampling Analog Input Pins to ADC

Other Parts Discussed in Thread: CC1310

Hi,

I am looking to sample an analog input signal from a thermocouple into the ADC on the CC1310. I have looked through the examples of the new ADC driver release in TI-RTOS and referred to the rfWsnNode driver example. The ADC is sampling output from the ambient light sensor in these examples. How can I change these examples to read data from from a different analog input?

Thanks,
Kyle

  • Hi Kyle,

    You would have to change the ADC_open() call to open the ADC that is connected to your input signal, instead of the ADC connected to the light sensor. The input of each ADC is configured via the ADC_config structure in CC1310_LAUNCHXL.c.

    Best regards,
    Vincent
  • Vincent,

    Thanks for your reply. I do not have a CC1310_LAUNCHXL.c file present in the adcsinglechannel driver example. Currently, each adc task is opened with the following call:

    adc = ADC_open(Board_ADC0, &params);

    Board_ADC0 is defined as CC1310DK_7XD_ADCVDDS, which is defined in the enum

    typedef enum CC1310DK_7XD_ADCName {
    CC1310DK_7XD_ADCALS = 0,
    CC1310DK_7XD_ADCDCOUPL,
    CC1310DK_7XD_ADCVSS,
    CC1310DK_7XD_ADCVDDS,
    CC1310DK_7XD_ADCCOUNT
    } CC1310DK_7XD_ADCName;

    I wish to configure one of the following IOs

    /* Analog capable DIO's */
    #define Board_DIO23_ANALOG IOID_23
    #define Board_DIO24_ANALOG IOID_24
    #define Board_DIO25_ANALOG IOID_25
    #define Board_DIO26_ANALOG IOID_26
    #define Board_DIO27_ANALOG IOID_27
    #define Board_DIO28_ANALOG IOID_28
    #define Board_DIO29_ANALOG IOID_29
    #define Board_DIO30_ANALOG IOID_30

    Do I still need to include the CC1310DK_7XD_ADCName in the open function? Also, what is the significance of the CC1310DK_7XD_ADCName enumeration? Is there any documentation I can use to refer to?
  • Hi Kyle,

    Sorry for the confusion. I didn't realize you were using the CC1310 Dev Kit and not the CC1310 Launchpad. The corresponding file in your case would be 'CC1310DK_7XD.c'.

    I think you should add/replace entries in the CC1310DK_7XD_ADCName enumeration for the IOs you want to sample. Each entry (except CC1310DK_7XD_ADCCOUNT) in the enumeration is just a name that corresponds to an entry in the ADC_config array, which in turn maps to an entry in the adcCC26xxHWAttrs array that defines the configuration of the ADC. By adding/setting up a corresponding entry in the adcCC26xxHWAttrs array that corresponds to the IO pin you wish to sample, you can then call ADC_open() on the new name to initialize it.

    Interestingly, if instead of looking at the example for the Dev Kit, you import the same example for the CC1310 Launchpad, you will see that CC1310_LAUNCHXL_ADCName in CC1310_LAUNCHXL.h and adcCC26xxHWAttrs in CC1310_LAUNCHXL.c have setup the pins you want to sample. Perhaps you can study them as reference.

    Best regards,
    Vincent