Hi, I m working on a project with KL25Z and I need as low power consumption as possible. For my app, I basically would need the MCU to quickly do all the instructions in VLPR and then sleep (VLPS), until I wake him up with an interrupt. I am using Kinetis design studio 3 for compiling and Ozone 2.22 for debugging. I am also using kinetis SDK 2.1.
With my code, I am able to enter VLPR mode, with a current consumption of 770 uA measured on J4 jumper. For VLPR mode, I set the SMC and then MCG mode from FEI to BLPI, all according to reference manual, core clock 1 MHz, bus clock 500 KHz.
But then, I have problems with entering inthe VLPS (very low power stop) mode. The consumption is nowhere near 5 uA as it should be. It actually doesn't sleep at all, according to SMC_PMSTAT register, it goes to normal run mode .Attached please find my code. I am trying to enter the VLPS in a loop, during which it should sleep and wake up on an interrupt from LPTMR.
Can anyone please help me correct my code? Or maybe propose an alternative to my code, to make it sleep in VLPS?
Thanks for answers
Original Attachment has been moved to: code.txt.zip