Hi,
I'm trying to achive STOP3 mode power consumption as low as shown in the MC9S08SH datasheet.
It says that in STOP3 + RTC enabled it should be 1.5uA + 500nA = 2uA but currently I can achieve only 100uA.
Below I have included my code.
void main(void) { EnableInterrupts; /* enable interrupts */ /* Set all pins as output and low */ PTADD = 0xFF; PTBDD = 0xFF; PTAD = 0x00; PTBD = 0x00; /* Configure LED */ PTBDD_PTBDD2 = 1; PTBD_PTBD2 = 1; /* 1 second RTC */ RTCSC_RTCLKS = 0x00; // Internal Clock RTCSC_RTIE = 1; // Interrupt Enable RTCSC_RTCPS = 0x0F; // 10^3 /* Interrupt every 1 sec */ RTCMOD = 0x00; /* Enable STOP mode */ SOPT1_STOPE = 1; /* Disable LVD when STOP */ SPMSC1_LVDE = 1; SPMSC1_LVDRE = 1; for(;;) { __RESET_WATCHDOG(); /* Enter STOP mode */ _Stop; /* Toggle LED */ PTBD_PTBD2 = 0; WaitNms(50); PTBD_PTBD2 = 1; } }
I will appreciate any help to achieve lower power consumption.
Thanks!
Janis
解決済! 解決策の投稿を見る。
Solved the problem!
It finds out that I hadn't set LVDSE to 0, which disables LVD while MCU is in STOP mode.
Janis
Hi Janis,
Welcome to the forum.
I do not see you seting port C to outputs. Could the extra current draw be from port C inputs floating?
Oh, forgot to mention that I use 16 pin version of MC9S08SH series microcontroller. So it has just port A and B.
Janis
Hello again Janis,
Just because you can't see them doesn't mean they are not there . . .
More specifically, just because Freescale does not bond-out those pins doesn't mean that they remove them from the die. Trust me, port C is there. Just like it shows in the data-sheet. You just can't physically get to them.
Try setting port C to output, and see if your current consumption goes down. It may not be your only problem, but it is certainly one of them. If you search for power-consumption topics on this board, you will find you are not alone. There are many things that can cause higher-than-expected current consumption.
Thanks rocco!
Didn't know they put the same die in different pin count packages. Sadly, port C didn't solve the problem.
Well, I looked through some topics but couldn't find any useful information.
Janis
Solved the problem!
It finds out that I hadn't set LVDSE to 0, which disables LVD while MCU is in STOP mode.
Janis