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.

CC3220SF-LAUNCHXL: CC3220 incorrect ADC reading in adcsinglechannel example

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF, ENERGIA, CC3220S

Hi,
I am following the adcsinglechannel_CC3220SF_LAUNCHXL_tirtos_ccs example and running it on a Launchpad. I didn't have a 0.1uF Cext as described in the appnote, but I provided a constant 1.1V to ADC1 (pin 60). The connection was made before CC3220SF was reset, and I also increased number of samples from 10 to 30. I would expect some error in the samples, and some sample should be close to 1.1V. However, all samples were around 0.476V. Would it be my device is broken? Or is this some kind of hardware limitation in CC3220SF? 

By the way, valid ADC input range is 0V to 1.4V, but the instruction in README.html stated that "For quick testing, connect CONFIG_ADC_0 to GND and CONFIG_ADC_1 to 3V3."

Sample output:

Starting the acdsinglechannel example

ADC0 raw result: 5

ADC1 raw result (0): 1329

ADC0 convert result: 1791 uV

ADC1 convert result (0): 476103 uV

ADC1 raw result (1): 1329

ADC1 convert result (1): 476103 uV

ADC1 raw result (2): 1330

ADC1 convert result (2): 476461 uV

ADC1 raw result (3): 1332

ADC1 convert result (3): 477178 uV

ADC1 raw result (4): 1328

ADC1 convert result (4): 475745 uV

ADC1 raw result (5): 1329

ADC1 convert result (5): 476103 uV

ADC1 raw result (6): 1327

ADC1 convert result (6): 475386 uV

ADC1 raw result (7): 1330

ADC1 convert result (7): 476461 uV

ADC1 raw result (8): 1327

ADC1 convert result (8): 475386 uV

ADC1 raw result (9): 1329

ADC1 convert result (9): 476103 uV


Thanks,
Dennis

  • Hi,

    We will look into it and get back to you ASAP. Please bear with us.

    Thanks,

    PM

  • Hi Dennis,

    The app note you linked to explains why not having the external capacitor will yield a large error in the measurement. 

    I think you may also find this thread useful: https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/t/814808?CC3220S-CC3220S-ADC 

    Thanks,

    Alexis

  • Hi Alexis,
    Thanks for the explanation. We will keep the voltage follower in mind when customizing our design.
    However, the inaccuracy was also observed in a CC3220SF Launchpad. I do see a voltage follower circuit in CC3220SF schematic, but I don't understand why the reading was not correct

    Thanks,
    Dennis

  • Hi,
    I am playing around with different voltages and still having some troubles getting correct ADC result. I can see the reading scales as input voltage change, but the reading is incorrect.
    Also, if I provide 1.4V to pin60, the reading is not near 4096 at all... Below is the result with 1.4V

    Starting the acdsinglechannel example

    ADC0 raw result: 6

    ADC1 raw result (0): 1456

    ADC0 convert result: 2149 uV

    ADC1 convert result (0): 521600 uV

    ADC1 raw result (1): 1468

    ADC1 convert result (1): 525898 uV

    ADC1 raw result (2): 1496

    ADC1 convert result (2): 535929 uV

    ADC1 raw result (3): 1439

    ADC1 convert result (3): 515509 uV

    ADC1 raw result (4): 1500

    ADC1 convert result (4): 537362 uV

    ADC1 raw result (5): 1446

    ADC1 convert result (5): 518017 uV

    ADC1 raw result (6): 1426

    ADC1 convert result (6): 510852 uV

    ADC1 raw result (7): 1414

    ADC1 convert result (7): 506553 uV

    ADC1 raw result (8): 1334

    ADC1 convert result (8): 477894 uV

    ADC1 raw result (9): 1488

    ADC1 convert result (9): 533063 uV

  • Hi Dennis,

    I just wanted to let you know that I'm still looking into this. I tried reproducing the issue and I'm also experiencing issues, so I'm currently trying to debug on my end. I appreciate your patience!

    Thanks,

    Alexis

  • Hi Alexis,
    Ok, thanks for getting back to me and really appreciate for looking into this! It is a great MCU with security features that we really plan to migrate to

    Thanks,
    Dennis

  • Hi Alexis,
    May I follow up with you on this? If you need more time, that is ok. I don't mean to rush you.

    Thanks,
    Dennis  

  • Hey Dennis,

    See if using alternative supply to the board solves it for you , as it seems , for me . See my thread :

    https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/p/880870/3258178#3258178

  • Hi v01d,
    Awesome discovery!
    To confirm, I should supply power from J22 (keep J19 untouched) and connect J9, ADC will be able to have correct reading? 
    By the way, since there is a voltage divider at the input of voltage follower, so I should expect the reading to be 0.42 of the voltage I apply to the analog pins (pin 57 - pin 60)?

    Thanks,
    Dennis 

  • Hey,

    Assuming "Rev-A" board for jumper naming.

    Yes power from J22 the 3.3V;   J19 and J17 are off, but then crossed / connected , i.e. VBAT connects to BRD.
    Please see the board manual which docs all jumper settings.

    Reading: you should read in code what the pin input is after the divider.   I tested pin 58, 59, 60.
    ( V[at pin] -->  Divider --> V[at ADC IN]  ;  OP_AMP jumper on / enabled)

  • Got it, v01d. For me, I think the incorrect reading was because I didn't take the voltage divider into account. The reading now makes sense and I am able to get correct reading for both USB power and battery power

    However, I have trouble getting correct reading using analogRead in Energia regardless USB power or battery power. I fed a 1.1V to pin58, I would expect after the divider, ADC code would be around 1351, but the actual reading is 334; I fed a 2.6V to pin58, expecting around 3194, but the actual reading is 778... Do you play around with Energia or do you mainly use CCS to do the development?

    Thanks,
    Dennis


     

  • Hi Dennis,

    Energia - no I do not.

    Hey could you share please your setup with USB power ...?   I would appreciate all jumper settings, etc.

    I'm using this board in a group, and there are at least another 2 - 3 people with me who do not get correct readings when it's just powered off the default USB connection for development.  All readings are off as per my thread I referred you to.

  • Hi v01d,
    Sorry for the delay. Here is my jumper configuration, and I was driving pin60 with different voltage.

    By the way, I switched my design to CC3220S because it has one extra GPIO pin (pin45) compared to CC3220SF. However, I also ran a ADC example on CC3220SF, and the result also seems to make sense...  


    Let me know if you need anything else,
    Dennis

  • Hi Dennis,

    Nothing else, all good. Figured out I had stuff connected on 2 pins, and it was feeding current in I think.

    Both now work correct - with USB power or external 3.3V.

  • Great to hear that and glad to help. I will also report analogRead issue in Energia forum

    Thanks,
    Dennis