Hi
I use a FRDM-KE06Z to test power consumption of KE06.
According to schematic, I removed R77 and R11 to measure power consumption of KE06.
I use KDS to create a project and only enable the "STOP operation mode" and generate "SetOperationMode".
Other setting of MCU is default, no external crystal/OSC enable.
According to datasheet, the typical current is around 2uA, but I measure the current is around 120uA.
Did I miss any setting or something wrong?
I attached my project code, thanks.
Original Attachment has been moved to: KE06.7z.zip
已解决! 转到解答。
Hello,
You need to disable the Low Voltage detector, which adds 120 uA to the current.
See the following code:
int main(void)
{
int counter = 0;
PMC_Init();
GoToLowPower(WAIT);
for(;;) {
counter++;
}
return 0;
}
void GoToLowPower (uint8_t OperationMode) {
switch (OperationMode) {
case WAIT:
/* SCB_SCR: SLEEPDEEP=0 */
SCB_SCR &= (uint32_t)~(uint32_t)(SCB_SCR_SLEEPDEEP_MASK);
/* SCB_SCR: SLEEPONEXIT=0 */
SCB_SCR &= (uint32_t)~(uint32_t)(SCB_SCR_SLEEPONEXIT_MASK);
__asm("WFI");
break;
case STOP:
/* SCB_SCR: SLEEPONEXIT=0 */
SCB_SCR &= (uint32_t)~(uint32_t)(SCB_SCR_SLEEPONEXIT_MASK);
/* SCB_SCR: SLEEPDEEP=1 */
SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;
__asm("WFI");
break;
default:
for(;;);
}
}
void PMC_Init () {
/* PMC_SPMSC2: LVDV=0,LVWV=0 */
PMC_SPMSC2 &= (uint8_t)~(uint8_t)(
PMC_SPMSC2_LVDV_MASK |
PMC_SPMSC2_LVWV(0x03)
);
/* PMC_SPMSC1: LVWACK=1,LVWIE=0,LVDRE=1,LVDSE=1,LVDE=1,??=0,BGBE=0 */
PMC_SPMSC1 = (uint8_t)((PMC_SPMSC1 & (uint8_t)~(uint8_t)(
PMC_SPMSC1_LVWIE_MASK |
PMC_SPMSC1_BGBE_MASK |
0x02U|
PMC_SPMSC1_LVDE_MASK
)) | (uint8_t)(
PMC_SPMSC1_LVWACK_MASK |
PMC_SPMSC1_LVDRE_MASK |
PMC_SPMSC1_LVDSE_MASK
));
}
Hello,
You need to disable the Low Voltage detector, which adds 120 uA to the current.
See the following code:
int main(void)
{
int counter = 0;
PMC_Init();
GoToLowPower(WAIT);
for(;;) {
counter++;
}
return 0;
}
void GoToLowPower (uint8_t OperationMode) {
switch (OperationMode) {
case WAIT:
/* SCB_SCR: SLEEPDEEP=0 */
SCB_SCR &= (uint32_t)~(uint32_t)(SCB_SCR_SLEEPDEEP_MASK);
/* SCB_SCR: SLEEPONEXIT=0 */
SCB_SCR &= (uint32_t)~(uint32_t)(SCB_SCR_SLEEPONEXIT_MASK);
__asm("WFI");
break;
case STOP:
/* SCB_SCR: SLEEPONEXIT=0 */
SCB_SCR &= (uint32_t)~(uint32_t)(SCB_SCR_SLEEPONEXIT_MASK);
/* SCB_SCR: SLEEPDEEP=1 */
SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;
__asm("WFI");
break;
default:
for(;;);
}
}
void PMC_Init () {
/* PMC_SPMSC2: LVDV=0,LVWV=0 */
PMC_SPMSC2 &= (uint8_t)~(uint8_t)(
PMC_SPMSC2_LVDV_MASK |
PMC_SPMSC2_LVWV(0x03)
);
/* PMC_SPMSC1: LVWACK=1,LVWIE=0,LVDRE=1,LVDSE=1,LVDE=1,??=0,BGBE=0 */
PMC_SPMSC1 = (uint8_t)((PMC_SPMSC1 & (uint8_t)~(uint8_t)(
PMC_SPMSC1_LVWIE_MASK |
PMC_SPMSC1_BGBE_MASK |
0x02U|
PMC_SPMSC1_LVDE_MASK
)) | (uint8_t)(
PMC_SPMSC1_LVWACK_MASK |
PMC_SPMSC1_LVDRE_MASK |
PMC_SPMSC1_LVDSE_MASK
));
}
Hi Kyle,
After had a brief look through the demo, I think the demo is correct.
My co-worker told me that there are some bugs with the FRDM-KE06 board, when you choose the 3.3v supply, the current consumption is good, however it will increase greatly when choose the 5v supply.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------