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.

CC2652RB: Reason to use ADC_close() and other close functions?

Part Number: CC2652RB
Other Parts Discussed in Thread: ENERGYTRACE

The adcsinglechannel.c thread going through initializing and opening the ADC module for each sample, then closing it. If I have an application that takes an ADC sample at 1Hz (from the same channel) is there any advantage to closing the channel with every sample? I guess the same goes for SPI, and I2C... would it be purely a benefit to memory or would it affect power consumption as well?

  • If you still use those driver later in your application, I don't think you need to call close function. There might be only a little benefit to memory but It might not be relevant too much on power consumption.

  • Matt, YiKai,

    Generally speaking, by closing the drivers you have an effect both on the memory (RAM) and on the power consumption. If you are interesting by the details, you can have a look to the drivers' source code (stored in <SDK>\source\ti\drivers\<DRIVER>\). For example, as you can see in the functions SPICC26X2DMA_close(), I2CCC26XX_close() and I2S_close(), the module is powered down (at least you stop clocking the module and remove the power dependency). This is also true for ADC_close(). As you can see the pin is closed by ADC_close() (i.e. the pin is set in the default state that should be more power effective). However the gain is not that big.
    Last point, the open-close procedures consume a bit of power (basically because some computation are run by the CPU).

    I suggest you to test the two options and see which one is the more power effective. As you are using a Launchpad, this can be easily done using EnergyTrace.

    Best regards,