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/LAUNCHXL-CC2640R2: CC2640R2--ADC pin configuration

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: CC1310

Tool/software: TI-RTOS

Hello,

I have CC2640R2 launchpad.

i am trying to change ADC configuration with another pins.
i am using "adcsinglechannel" example from Resource explore it works fine.


but when i trying to change ADC pins from IOID_23 and IOID_24 with IOID_25 and IOID_26 in CC2640R2_LAUNCHXL.h file,these didnit work

i observed that signal generate still on IOID_23 and IOID_24 even though i changed the pin configuration in CC2640R2_LAUNCHXL.h file

1)what i did wrong?
2)how to change ADC pin?

Thanks

  • In the board files nearly everything is set up so all 8 analog pins can be used.

    The code below from the board files are for CC1310 since that was the project I had open but it's the same structure for CC2640R2.

    typedef enum CC1310_LAUNCHXL_ADCName {
        CC1310_LAUNCHXL_ADC0 = 0,
        CC1310_LAUNCHXL_ADC1,
        CC1310_LAUNCHXL_ADC2,
        CC1310_LAUNCHXL_ADC3,
        CC1310_LAUNCHXL_ADC4,
        CC1310_LAUNCHXL_ADC5,
        CC1310_LAUNCHXL_ADC6,
        CC1310_LAUNCHXL_ADC7,
        CC1310_LAUNCHXL_ADCDCOUPL,
        CC1310_LAUNCHXL_ADCVSS,
        CC1310_LAUNCHXL_ADCVDDS,
    
        CC1310_LAUNCHXL_ADCCOUNT
    } CC1310_LAUNCHXL_ADCName;

    #define Board_ADC0 CC1310_LAUNCHXL_ADC0
    #define Board_ADC1 CC1310_LAUNCHXL_ADC1

    Try to define and use a Board_ADCx that correspond to the pins you want to use. Since these structs uses an index that would be Board_ADC2 and Board_ADC3 without changing the pin assignment.  

    You can read more about how the drivers are built up here: http://dev.ti.com/tirex/content/simplelink_academy_cc2640r2sdk_2_20_03_05/modules/tidrivers/ti_drivers_config/ti_drivers_config.html

  • I suppose you should change

    #define Board_ADC0 CC2640R2_LAUNCHXL_ADC0
    #define Board_ADC1 CC2640R2_LAUNCHXL_ADC1

    to

    #define Board_ADC0 CC2640R2_LAUNCHXL_ADC2
    #define Board_ADC1 CC2640R2_LAUNCHXL_ADC3