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.

CC2652R7: ADC results are affected when the MCU comes out of standby mode

Part Number: CC2652R7

Tool/software:

Hello.

I am developing a voltage sensor that uses the Sensor Controller to continuously read the ADC, average the readings, and push the ADC values up to a fifo.  The main MCU code then periodically wakes up the TI-RTOS message loop to process the Sensor Controller’s fifo data and update an OLED display with the measured data.  I also push the sampled data out to our data analysis app via BLE.

My problem is that when the MCU wakes up to process the data, the transition from standby mode to active mode causes the ADC data to be skewed by one or two LSBs.  I’m assuming that this is caused by the newly turned on power domains affecting the ADC’s Vref.

I tried mitigating this by preventing the power domain switch via Power_setConstraint(PowerCC26XX_SB_DISALLOW), but it only reduced the problem by about half.

Here is a graph of the data I am seeing:

The ADC is sampling every 10us, but I am averaging every 1000 ADC reads, so each data point is 10ms apart.  I process the data and update the display every 500ms and it takes ~100ms to do the processing.  You can see that during the 100ms period, the ADC values are shifted up a bit.  Note that I multiply the ADC sum by 16 before dividing by 1000 which makes it look like the averaged reading is from a 16-bit ADC instead of the actual 12-bit ADC, so the actual error is one or two ADC LSBs and not the 20-ish LSBs you see on the graph.

Do you have any suggestions on how to prevent this from happening?

Thank you
Scott

  • I tried this in the main task loop and it seems to work.  Of course the downside is increased current draw while running:

            // Hard loop waiting for events to prevent going into sleep mode while waiting for events.
            // This prevents perturbations in the ADC data when the power domains are being switched on/off.
            while( !(Event_getPostedEvents( syncEvent ) & (SP_ALL_EVENTS | SBP_ALL_EVENTS)) )
                continue;
    
            events = Event_pend( syncEvent, Event_Id_NONE, SP_ALL_EVENTS | SBP_ALL_EVENTS, ICALL_TIMEOUT_FOREVER );
    

    Does anybody have any more power efficient ideas?

  • Hi Scott,

    There are multiple Power modes on our device, including Active, Standby, and also Idle. Preventing standby still allows entering Idle, which has a lower current consumption than Active. So when device transitions from Idle to Active, this may cause a transient dip in the voltage.

    Your method of looping to prevent Standby mode (sleep) actually also prevents Idle mode, so this maintains the steady current draw of the device, keeping the ADC voltage readings steady as well.

    From SW perspective, enabling more power efficiency is going to require those transitions from Power modes, which means these Voltage reading will happen in real time. A SW solution could be to filter out those reading specifically, for example if the system only cares about what the Voltage looks like in Standby.

    From HW perspective, you could potentially add a big enough capacitor to smooth out any 100 ms spikes -- if other HW solutions interest you, I can loop in a HW expert.

    Thanks,
    Toby

  • Hi Toby.

    Thank you for the suggestion, but unfortunately I need to continuously sample the data so I can average/smooth it and graph it in real time.  I can't do anything that involves breaking the continuity of the sampled data.

    I did the following things to reduce the noise and it appears to work well enough for my needs:

    • My little sleepless event loop trick.
    • Power_setConstraint() to prevent idle or standby mode when making other system calls.
    • Changing the ADC Vref from VDDS to the internal fixed reference to prevent BLE radio transmissions from causing noise via VDD bounciness.

    It looks like I can live with the extra few mA it will cost me.

    Thank you for the help.
    Scott