low power mode for KL24z

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

low power mode for KL24z

1,008 Views
mikeconover
Contributor II

I am using a KL24Z processor and for some reason I can't get the processor below around 3.65 mA when I put it in low power mode. I am using MQX lite in a Code Warrior project with processor expert. I am using a JTAG cable to program it and when I measure the 3.65mA, that is with the JTAG cable unplugged.

I followed this guide exactly minus the board changes because I have a custom made board and don't need to cut traces and all that fun stuff. Tutorial: Using the FRDM-KL25Z as Low Power Board | MCU on Eclipse

In my project, I have 3 different clock configurations. Clock configuration 0 is used to generate the 48MHz clock for the USB. Clock configuration 1 is used for low power mode and clock config 2 is for normal operation when USB isn't used. For my current test, I am not using the USB clock configuration. So, I start out in clock configuration 2 and then switch to clock configuration 1 which is the exact same setup as in this guide MCU eclipse guide. One thing that is different, is that I have the system oscillator enabled in my project. When I execute Cpu_SetOperationMode(DOM_STOP, NULL, NULL);   what exactly happens to all of the clocks, peripherals and IO pins?? I have tried all the different low power modes, but get the same current draw. :smileysad:

     1. Will this automatically disable the system oscillator?

     2. Do all of the peripherals get disabled automatically? 

     3. Do I have to go through all the IO pins and set them to the correct state or will they all be driven low?

Let me know if you need screenshots of all the processor expert settings in order to help.

Thanks a lot,

Mike

0 Kudos
9 Replies

653 Views
mikeconover
Contributor II

I am making some progress. I basically just started a brand new project with no peripherals or anything and I am trying low power mode like that. I am measuring around 900uA, so that is looking better. However, I should be able to get it much lower. I wonder where the power draw is coming from in my other project. Anyways, I am going to mess around with this bare bones project some more. Another question I have is, in my processor expert, I only have Basic and Advanced tabs. How do I get the expert tab, and will that help at all??

Thanks,

Mike

0 Kudos

653 Views
mikeconover
Contributor II

One weird thing that I just noticed is that I have this statement here WAIT1_Waitms(10000); and it draws around 450uA, then when this statement Cpu_SetOperationMode(DOM_STOP, NULL, NULL); gets executed it pulls around 930uA. Why is that? I would expect it to draw very little current in low power mode??

0 Kudos

653 Views
mjbcswitzerland
Specialist V

Hi Mike

As you known there are many things influencing the curent consumption - I suppose the command that you are using switches the processor to the stop mode but it is not clear which peripherals you have still active and how you need to wake from the stop mode, which clocks are running and which not.

You have a custom board with KL24 but you may be able to run KL25 code on it (assuming 8MHz crystal) and could try the binary at http://www.utasker.com/kinetis/FRDM-KL25Z.html

which allows switching in between various LP modes.

I measure about 8mA CPU current when alwas in RUN mode and about 6mA when utilising the WAIT mode, 1.7mA utilising the STOP mode (with 48MHz still operating), about 50uA average in VLPS (waking 20x a second to service a LPT TICK in temporary RUN  mode at 48MHz, but PLL disabled in each sleep period).

Since there is such a variety of permutations exact comparisons may be difficult but it may give you a feel as to whether you are in the right ball-park.

Regards

Mark

http://www.utasker.com/kinetis.html

0 Kudos

653 Views
mikeconover
Contributor II

Thanks for the reply Mark. When you say you get about 50uA in VLPS, how are you getting into VLPS? Do you just use Cpu_SetOperationMode(DOM_STOP, NULL, NULL);?

0 Kudos

653 Views
mjbcswitzerland
Specialist V

Hi Mike

I don't use the same calls as you since this is integrated into the uTasker project but I suspect the Cpu_SetOpenation(DOM_STOP...) is setting the SLEEPDEEP bit and executig the wfi instruction which is setting the standard STOP mode.

To get to VLPS simply set

    SMC_PMPROT |= SMC_PMPROT_AVLP;
    SMC_PMCTRL = (SMC_PMCTRL_RUNM_NORMAL | SMC_PMCTRL_STOPM_VLPS | SMC_PMCTRL_LPWUI);

and then call the (same) STOP mode.

You need to check the state of clocks and peripherals in this mode (and the other low power ones) since they control "additional" levels of shut down from the standard STOP mode, so need to match your application's needs (like wakeup requirements and speed of coming out of the low power mode).

Since there are many permutations to match many requirements I tend to concentrate on allowing the board to operate as if it were not using any low power modes but continue to react to its environment - see Using Kinetis Low Power Stop Modes with unrestricted UART operation - a report

Regards

Mark

0 Kudos

653 Views
mikeconover
Contributor II

Thanks a lot Mark! :smileyhappy:

I have been able to make some progress it looks like. When I am running, I am pulling about 450uA and then when I go into VLPS, I get down to around 280uA.

I was looking at AN4503 and was trying to go into VLLS3 and I will probably want to eventually use VLLS1 or VLLS0. However, when I used the suggested code, SMC_VLLSCTRL = SMC_VLLSCTRL_VLLSM(3); I get errors about not finding the SMC_VLLSCTRL  register.

Have you been able to use VLLS3, VLLS1, or VLLS0? If so, how did you do that?

Thanks a lot,

Mike

0 Kudos

653 Views
mjbcswitzerland
Specialist V

Mike

In VLS3 on the KL25 I get about 80uA but I haven't studied KL VLS0, VLS1 and VLS3 modes since they need to processor to stop its 'normal' behaviour.

I can set them and get the processor stopping but I don't know whether they are (absolutely) correct (as they haven't really interested me greatly to date).

The uTasker project does the following (for KL parts) as reference:

VLLS0:

SMC_PMPROT |= SMC_PMPROT_AVLLS;

SMC_PMCTRL = (SMC_PMCTRL_RUNM_NORMAL | SMC_PMCTRL_STOPM_VLLSx);

VLLS1:

SMC_PMPROT |= SMC_PMPROT_AVLLS;

SMC_STOPCTRL = (unsigned char)(SMC_STOPCTRL_VLLSM_VLLS1 | (new_lp_mode & LOW_POWER_OPTIONS));

VLLS3:

SMC_PMPROT |= SMC_PMPROT_AVLLS;

SMC_STOPCTRL = (unsigned char)(SMC_STOPCTRL_VLLSM_VLLS3 | (new_lp_mode & LOW_POWER_OPTIONS));

There are some processor-specific options included but I have these (new_lp_mode) set to 0 generally.

Regards

Mark

http://www.utasker.com/kinetis.html

0 Kudos

653 Views
mikeconover
Contributor II

Woohoo!! I had to modify the registers a little for my project, but it is looking good! :smileyhappy: I am getting around 110uA, which is good because I cut the power traces to the KL24z and was measuring something around there.

I can't thank you enough! If you are ever near Austin, let me know and I will buy you a beer! :smileywink:

0 Kudos

653 Views
mjbcswitzerland
Specialist V

Hi Mike

Good to hear that you could make some headway and thanks for the offer.

I am presently working on two Kinetis projects in Austin (K20 and K70) and one (K64) in Houston (in your state), but my office is in Switzerland so I don't know when or if I can take you up on the offer of a beer (since one can do pretty much everthing over the Internet nowadays, the closest I get to being there is some debugging over remote desktop....)

My brother lives in Houston though, but I'll not send him over to collect ;-)

Regards

Mark

http://www.utasker.com/kinetis.html

0 Kudos