I am using ATSAM4S8B. The main code consists of while (1) loop and an interrupt every 1 mili-sec. With all the code/ logic completed - board is drawing around ~30mA. In some conditions (generally power down - which any way I am detecting) - I should go to very low power mode backup/ wait / sleep (Sample code I took from example code). With respect to this.
/* Enable the PIO for wake-up */
/* Switch MCK to slow clock */
/* Disable unused clock to save power */
//Disalble all the peripherals....
/* Enter into backup mode */
pmc_enable_backupmode(); //This function is below...
#if (SAM4C || SAM4CM || SAM4CP)
uint32_t tmp = SUPC->SUPC_MR & ~(SUPC_MR_BUPPOREN | SUPC_MR_KEY_Msk);
SUPC->SUPC_MR = tmp | SUPC_MR_KEY_PASSWD;
while (SUPC->SUPC_SR & SUPC_SR_BUPPORS);
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
#if (SAM4S || SAM4E || SAM4N || SAM4C || SAM4CM || SAM4CP)
SUPC->SUPC_CR = SUPC_CR_KEY_PASSWD | SUPC_CR_VROFF_STOP_VREG;
1. Can I enter into this mode from interrupt? Seems I have read, in interrupt context Corext M4 core can not execute WFE/ WFI instructions (these are mainly controlled by hw)
2. Tried also entering into this Low power mode in main loop - still I do not see any change in current usage (seems the low power mode is not entered).
3. Is there any ATMEL document which explains on how to enter low power states (I am using some of the peripheals - think I have disabled them all - but still some of the peripheral being active - can be problem - trying to debug this now).
4. Any one has entered low powered modes on SAM4S8B devices (or variant) and typically what is the current consumed in these low power modes?
With best regards,
Discussion around product based on ARM Cortex M4 core.
2 posts • Page 1 of 1
Who is online
Users browsing this forum: Baidu [Spider] and 2 guests