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-CC2640R2

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: CC2640,

I am working on LAUNCHXL-CC2640R2 Development Board for Custom PCB CC2640 IDE – CCS Cloud Version 1.2.0 SimpleLink CC2640R2 SDK - 5.30.00.03 TI Code Generation Tools for Arm: 18.12.2.LTS XDCTools: 3.51.03.28 Imported Simple Peripheral Project and have defined it for CC2640R2DK_CXS Please tell me correctly how to configure DIO pin12 for ADC input. Which files need to be modified?

  • Hello Shweta,

    Thanks for reaching out. Could you please share how you are configuring the ADC so far (a code-snipped can help)

    Meanwhile I can suggest looking inside out Users Guide for the ADC drivers reference: here. To see how to use the driver.

    BR,

    David.

  • Hello David,

    This is regarding the ADC configuration which is targeted for CC2640R2FYFVR on Custom Board.

     

    Please find below details for your consideration and provide the requested information/solution:

     

    TI Product - LAUNCHXL-CC2640R2

    Targeted for CC2640R2FYFVR on Custom Board

    IDE – CCS Cloud Version 1.2.0

    SimpleLink CC2640R2 SDK - 5.30.00.03

    TI Code Generation Tools for Arm: 18.12.2.LTS

    XDCTools: 3.51.03.28

     

    Imported Sample Project and have defined it for CC2640R2DK_CXS.

    Below is the code Snippet for ADC configuration.

     

    #include <ti/drivers/ADC.h>

     

    // Define name for ADC index

    // This is an index into the ADC_config[] array

    #define ADC_INSTANCE    0

     

    // One-time init of ADC driver

    ADC_init();

     

    // Initialize optional ADC parameters

    ADC_Params params;

    ADC_Params_init(&params);

     

    // Open ADC instance for usage

    ADC_Handle adcHandle = ADC_open(ADC_INSTANCE, &params);

     

    // Sample the analog pin

    ADC_convert(adcHandle, &result);

     

    // Convert the sample to microvolts

    resultUv = ADC_convertToMicroVolts(adcHandle, result);

     

    ADC_close(adcHandle);

     

    Questions:

    Where to find the information on ADC instances and their mapping with the Analog pins for CC2640R2DK_CXS?

    How to change the routing of .adcDIO to the ADC instance?

    How to configure ADC instance for CC2640R2DK_CXS_DIO12_ANALOG ?

    Not able to change the value of .adcDIO from PIN_UNASSIGNED to CC2640R2DK_CXS_DIO12_ANALOG in adcCC26xxHWAttrs programmatically and manually as well.

  • Hello,

    You can look into the ADCCC26XX.h reference file. There you can see the ADCCC26XX_HWAttrs Struct that you can use to define the .adcDIO.

    I would suggest also the ADC driver example found inside <SDK>\examples\nortos\CC2640R2_LAUNCHXL\drivers\adcbufcontinuous

    BR,

    David.

  • Hello David,

    Thank you for the reply.

    It would be great if you could provide more information on " There you can see the ADCCC26XX_HWAttrs Struct that you can use to define the .adcDIO. "

    Thanks & regards,
    Shweta Savdekar

  • Hello Shweta,

    Inside the "CC2640R2_LAUNCHXL.c" file you should be able to see an "ADC" section, which is where the analog pin is configured at the ADCCC26XX_HWAttrs struct. Mapping of the ADC pins can be found in the "CC2640R2_LAUNCHXL.h" file. In the Board.h file you can see the defines for the adc/analog pins (Board_ADCBUF0CHANNEL0 for example), which is then used inside the "adcBufContinuousSampling.c" for ".adcChannel" configuration.

    There are two example you can refer to inside the SDK: adcsinglechannel and adcbufcontinuous (<SDK>\examples\rtos\CC2640R2_LAUNCHXL\drivers)

    BR,

    David.

  • Hello David,

    Please let me know the steps on how to configure ADC for read pulses on CC2640R2DK_CXS_DIO12_ANALOG pin for CC2640R2FYFVR.

    As this will help with further module enhancement for our project.

    Thanks & regards,

    Shweta Savdekae

  • Hello Shweta,

    Have you been able to review the examples I shared?

    BR,

    David.