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.

CC2640 - Sensor Controller power consumption

Other Parts Discussed in Thread: CC2640

Hi everyone,

I'm using the sensor controller of my CC2640 to drive a step-by-step motor. I need to use ADC and delay insertions, and user the less power as possible. 

But when I start the sensor controller, it already use 600uA without doing anything :

// Initialisation code
U16 k = 0;
do {
    fwDelayUs(10000, FW_DELAY_RANGE_100_MS);
    k = k + 1;
}while(k != 250);

fwScheduleTask(1);

The sensor controller should use 8.2uA / Mhz, so around 200uA at 24Mhz, and even at 12Mhz it still use 550uA. I show you the Init / start / stop functions I use. Thanks in advance for your help

/* Initialize the Sensor Controller  */
SCIF_RESULT_T SensorController_init()
{
	// Enable power domains
	PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
	while (PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH) != PRCM_DOMAIN_POWER_ON);

	// Enable peripheral clocks
	PRCMPeripheralRunEnable(PRCM_PERIPH_GPIO);
	PRCMLoadSet();
	while (!PRCMLoadGet());

    scifOsalEnableAuxDomainAccess();						// Prevent AUX from powering down
	scifOsalInit();											// Initializes the OSAL
	scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);	// Register callback method for Task alert

	//*Set activ mode in low frequency
	HWREG(AUX_WUC_BASE + AUX_WUC_O_CLKLFREQ) = 1;
	while(HWREG(AUX_WUC_BASE + AUX_WUC_O_CLKLFACK) != 1);

	HWREG(AUX_WUC_BASE + AUX_WUC_O_CLKLFREQ) = 0;
	while(HWREG(AUX_WUC_BASE + AUX_WUC_O_CLKLFACK) != 0);

	// Use less than 24Mhz
	HWREG(AON_WUC_BASE + AON_WUC_O_AUXCLK) |= AON_WUC_AUXCLK_SCLK_HF_DIV_DIV4 ;

	return scifInit(&scifDriverSetup);						// Enable the driver
}

 /* Start one time init-execute-terminate session  */
SCIF_RESULT_T SensorController_start_once()
{
	scifStartRtcTicksNow(0x100);	// Start ticks (for alert events)	bit 15:0 -> 1/65536 of seconds, about 100us

    // Open the AUX I/O latches, which have undefined value after power-up. AUX_AIODIO will by default
    // drive '0' on all I/O pins, so AUX_AIODIO must be configured before IOC
    HWREG(AUX_WUC_BASE + AUX_WUC_O_AUXIOLATCH) = AUX_WUC_AUXIOLATCH_EN_TRANSP;

	//scifTaskResourceInit();		  								// Start I/O
	return scifCtrlTasksNbl(BV(SCIF_MOTOR_CONTROL_TASK_ID), 0x07);	// Init and execute sensor (not termintae)
}

 /* Stop ticks and Sensor Controller task */
SCIF_RESULT_T SensorController_stop()
{
	SCIF_RESULT_T res = SCIF_SUCCESS;

	res = scifStopTasksNbl(BV(SCIF_MOTOR_CONTROL_TASK_ID));
	if(res == SCIF_SUCCESS)
	{
		while(scifWaitOnNbl(0) != SCIF_SUCCESS);

		scifStopRtcTicks();
	    // Wait until the Sensor Controller is idle (it might still be running, though not for long)
	    while (!(HWREG(AUX_SCE_BASE + AUX_SCE_O_CPUSTAT) & AUX_SCE_CPUSTAT_SLEEP_M));

		scifTaskResourceUninit();	// Disable I/O
	}
	return res;
}

/* Task Main function : */
if(SCIF_SUCCESS == SensorController_start_once())
{
	// Wait semaphore
	Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);
	scifClearAlertIntSource();

	// Stop sensor controller
	scifAckAlertEvents();

	while(SensorController_stop() != SCIF_SUCCESS);
}

  • Hi Pittet,

    I will forward your question to a sensor controller expert.

    - Cetri
  • Thanks Eirik V,

    I didn't see in the datasheet or in the Technical Reference manual that 500uA are used to power up the sensor controller ? Anyway, if I you use the sensor controller with scheduled task operation, can I hope that the system will not use those 500uA while waiting ?

    Thanks in advance
  • It will only draw 500uA while the 24MHz system clock is running ( tasks are running).
    If you use RTC based scheduling the full system will be in standby drawing approx 1uA between wakeups. The same goes for waking up on an IO or timer event which will be supported in the next version.

    Regards,
    Svend
  • Thank you for the answers, I got it worked as wanted.

    I saw some errors with the RTC ticks used by the sensor controller, i use the function scifStartRtcTicksNow and the gap is not always the same even when I double the value. Sometimes it is even not stable.

    RTC ticks period value - time between reset of execution task in SCE

    0x00000006 - 275us

    0x0000000C - 183us (should be greater than 275us)

    0x00000011 - 257us (should be greater than 275us and not stable)

    0x00000024 - 550us

    0x00000048 - 1.1ms

    SCIF_RESULT_T SensorController_start_once()
    {
    	scifStartRtcTicksNow(0x00000024);	// Start ticks on RTC Ch2, bit 15:0 -> 1/65536 of seconds
    	
    	// Open the AUX I/O latches, which have undefined value after power-up. AUX_AIODIO will by default
    	// drive '0' on all I/O pins, so AUX_AIODIO must be configured before IOC
    	HWREG(AUX_WUC_BASE + AUX_WUC_O_AUXIOLATCH) = AUX_WUC_AUXIOLATCH_EN_TRANSP;
    	
    	scifTaskResourceInit();	// Start I/O
    	
    	return scifCtrlTasksNbl(BV(SCIF_MOTOR_CONTROL_TASK_ID), 0x01);	// Init and execute and terminate
    }

  • The RTC clock source is typically the 32.768kHz LF crystal. When the RTC is incremented an interrupt will be generated when the count value is equal or larger than the compare value. If the intervals set up by you does not match exactly with the increments you will see some variance
    See register descriptions in SWCU117 (Ch 14.4.1 ) for details, especially SEC, SUBSEC and SUBSECINC.

    In addition to this if the M3 is already running, there will be no delay for starting up the supply system. This can also introduce up to 100us variance in task execution time.

    Svend
  • Also make sure to use a tickPeriod that is bigger than the duration of the task.