Hi,
We are currently trying to implement VLLS on an MK22FN256 MCU. We are designing a battery powered device that should wake up every 15 minutes or so, but the device needs to last months on a single charge and thus we need to minimize the power consumption as much as possible
We are able to enter and exit sleep mode via the Cpu_SetOperationMode(DOM_SLEEP, NULL, NULL);
command and wake using a TimerUnit interrupt that is configured for the LPTMR_CMR.Hopever the power draw in this mode is around 3mA which is far too much for out purpose.
We can enter VLLS mode using DOM_STOP which provides are much more appropriate power draw at 100uA, but we but are no longer able to exit it using the low power timer interrupt.
We are using Kinetis with processor expert as our design environment, and have been unable to find precisely how we would go about it.
Is anyone able to offer any advice on how we would be able to use a timer to exit VLLS?
Cheers!
Hi Russell,
Please download FRDM_K22F SDK from Welcome | MCUXpresso SDK Builder . There is a low power enter and exit demo in this SDK (power_mode_switch). It use LPTMR to wake up system.
Regards,
Jing
Hi, thanks for your suggestion but that is using a completely different IDE and code structure and does not really help us much with Kinetis.
Hi Russell
In my experience VLLS0 can't wake from the LPTMR (it can wake from LLWU ports though).
- VLLS1, VLLS2 and VLLS3 can wake from LPTMR.
Therefore if you avoid VLLS0 you may be OK.
I have attached a binary file for the FRDM-K22F which demonstrates the operation:
1. Load the code with the usal drag-and-drop method on to the board when it appears as an external drive
2. When it runs the green LED flashes at 2.5Hz and every 5s the LPTMR interrupt will toggle the RED LED
By default the processor is sleeping in WAIT state when there are no interrupts
3. On its VCOM UART conection at 115k there is a menu - hit the enter key to see it:
Hello, world... FRDM-K22F [Software]
Static memory = 0x00000a7c
OS Heap use = 0x0219 from 0x6000
Initial stack margin 0x000193ec
WOKEN - restoring WAIT mode
Serial number: 00
Software version V1.4.012
Device identification: KINETIS
Main menu
===================
1 Configure LAN interface
2 Configure serial interface
3 Go to I/O menu
4 Go to administration menu
5 Go to overview/statistics menu
6 Go to USB menu
7 Go to I2C menu
8 Go to utFAT disk interface
9 FTP/TELNET commands
a CAN commands
help Display menu specific help
quit Leave command mode
4. Go to the Administrator menu by entering 4 and ENTER
Admin. menu
===================
up go to main menu
show_config Show configuration
save Save configuration to FLASH
reject Reset non-saved changes
restore Restore factory settings
show_time Display date/time
set_time Set time hh:mm:ss
set_date Set Date dd:mm:yyyy
show_alarm Display alarm d/t
set_alarm Set alarm (date)(+)[time]
del_alarm Delete alarm
show_lp Show low power mode and options
set_lp [option] Set low power mode
wdog Watchdog
boot Reset to boot loader
reset Reset device
last_rst Reset cause
help Display menu specific help
quit Leave command mode
5. List the low power modes available with "show_lp"
#show_lp
RUN = 0
WAIT = 1 [active]
STOP = 2
VLPR = 3
VLPW = 4
VLPS = 5
LLS2 = 6
LLS3 = 7
VLLS0 = 8
VLLS1 = 9
VLLS2 = 10
VLLS3 = 11
6. You can test the various low power modes with, for example
"set_lp 5"
In the modes that can wake by LPTMR interrupt the LPTMR will still toggle the red LED every 5s and the current consumption can be measured and compared
7. You can compare the 4 VLLS modes and you will see that "set_lp 9, 10 and 11" will reset each time the LPTMR fires (wake up form VLLSx modes is always via reset).
"set_lp 8" will show that the processor is set to the VLSS0 but the LPTMR no longer wakes.
However there is also a LLWU set on the input SW2 which can wake it at any time.
Hello, world... FRDM-K22F [Wakeup]
Static memory = 0x00000a7c
OS Heap use = 0x0219 from 0x6000
Initial stack margin 0x000193dc
WOKEN - restoring WAIT mode
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]