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.

how to access ADC via both SCE and MCU of CC2640

Other Parts Discussed in Thread: CC2640, CC3200

Dears, 

due to my special application, I have to run two tasks,  task 1 is battery voltage monitoring (run once every 30 second), and task 2 (run once every 10ms) is monitoring external temp sensor and display the temp via LCD,  task 2 occupied all the 14pin of SCE, so, task 1 should run in MCU. these two tasks are asynchronous, and running in different core(one for SEC, and one for MCU), but they share one ADC.

my question is how to access ADC in MCU, and how avoid the conflict when SCE and MCU access ADC in the same time. thanks in advance!

Best Regard!

Gerry Li

  • Hello Gerry,
    Please consider using the battery monitor. Can this work for you instead of suing the ADC?
    Read all the details in CC13xx, CC26xx SimpleLink Wireless MCU Technical Reference Manual

  • Hi Eirik,

    due to the space limitation, we use external LDO instead of internal DC-DC, so, the battery is not connected to MCU directly. thanks!

    Best Regard!

    Gerry Li

  • Hello Gerry,

    The current consumption for CC2640 will usually be higher when not using a DCDC. Is it the filtering and external inductor required that takes up to much space?

    We don't have a TI-RTOS ADC driver, but SCS has features for sharing peripherals safely by the use of the AUX semaphores (SMPH1-4). There is an example for how to use this in the SCS documentation:

    file:///C:/Program%20Files%20(x86)/Texas%20Instruments/Sensor%20Controller%20Studio/resource_docs/peripheral_sharing.html

    Although we do not have ADC driver you can find example code for how to access the ADC from the application processor here:

    https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/p/404426/1433112#1433112

    Warning: This is an example only and you will need to understand and implement this in a safe manner yourselves for now. For example the TI-RTOS power manager can get "confused" if you where to directly disable power and/or clocks as these are managed by the device specific power manager. Driver implementations use the calls Power_setDependency and Power_releaseDependency to let the power manager decide when to power on and off. You can read more details on this in "TI-RTOS 2.15 Power Management: MSP432, CC13xx/CC26xx, and CC3200 SimpleLink MCUs".

  • Dear Eirik,
    Thanks for your help! Sorry for confusedness that why we did not adopt the internal DC-DC is my application needs a boost DC-DC. when the battery is full power, the boost DC-DC was by-passed automatically, and when it is low battery, the boost DC-DC will work, that will make sure my GPIO will drive LED well.
    Let's go back to the battery monitor. if I use the battery monitor, the battery will be connected to CC2640 directly. due to the GPIOs(controlled by SCE) are driving external LEDs, if it is possible that the GPIOs powered by external power, while the other parts of CC2640 are powered by battery?

    Best Regards!
    Gerry Li
  • Hello Gerry,
    We have not tested different voltage levels for the different power domains yet and it is therefore not supported as of now. Unfortunately it is not currently decided any plan for this.

    BTW:
    The ADC will need a analog pin input. So you will either need to reorganize your pins, use the battery monitor or set up an external scheme for measuring the battery voltage.