Hi All
I pointed out in a previous post that the binary at µTasker Kinetis FRDM-K22F support consumes about 120uA in LLS, which is a magnitude higher than that what is actually expected in the very worst case.
Therefore I decided to take a closer look to find out why.
The binary that I used as reference has USB-CDC operating before moving to the LLS mode and this is a composite USB device with 3 UART bridges.
I tried changing some project settings and found that as soon as I reduced the number of USB-CDC devices to a single one the current went down to 4uA.
Since the USB is the same irrespetive of the number of CDC interfaces I then checked the UARTs being used but didn't find any loading paths on the board when they are enabled and connected to their ports.
By removing the UART MUX function at the pins the current also reduced to 4uA in LLS even with three UARTs configured.
What I then found was that by touching the UART lines with my fingers I could influence the LLS current. So obviously leaving them floating was not good.
I subsequently configured pull up resistors on the UART Tx and Rx lines and then the original software configuration could be set to LLS with 4uA current consumption. Note that both Rx and Tx are important.
This means that to ensure that the values are not higher than expected there is a fairly simple rule:
- don't let any pins configured as peripherals float when in a low leakage mode since this obviously causes quite high leakage currents to result
- if the HW doesn't define the state, enable pull-ups or pull-downs to suit to keep them stable.
Then the results are as expected!
I have attached a binary for anyone interested in verifying it. The USB device can be connected and it will appear as 3 x virtual COM ports, whereby the processor current is about 20mA (it is dynamically using WAIT mode whenever it can, otherwise the RUN mode current is about 35mA).
On the OpenSDA virtual COM at 115200 Baud move to the Administrator menu and command the LLS mode with "set_lp 5" and the USB will disconnect and the processor current drops to < 4uA.
Press the button SW2 and the processor wakes back to full operation and the USB connect again. Repeat as rquired.
Regards
Mark
Kinetis: µTasker Kinetis support
K22: µTasker Kinetis FRDM-K22F support / µTasker Kinetis TWR-K22F120M support
For the complete "out-of-the-box" Kinetis experience and faster time to market