The Freedom-K64F is an ultra-low-cost development platform for Kinetis K64, K63, and K24 MCUs.

K64F power consumption

13 Nov 2015

I am curious about the power consumption of the various components on the mbed K64F board. With meter spliced into hacked USB cable, I measure 139ma with MCU running in a loop. The data sheets suggest MCU consumes 40ma, ether PHY 46ma, SDA 17ma. That still leaves 30ma unaccounted for. There are LDOs, LEDs, USB, but I wouldn't think they would add up to 30 more ma. What am I missing?

The LPC1768 has a library that can power down the Ether PHY saving 40 ma. Has anyone developed a PHY powerdown for the K64F? Since the Ether PHY provides the 50MHz clock for the K64F MCU, I am wondering if reducing power to PHY would also require configuring an alternate clock for the MCU.

16 Nov 2015

How did you measure the power? Did you accounted for the interface on board (running on K20 mcu) (not certain if SDA reference above is for the interface chip or not, but would say not as it 's not part of the datasheet, but the board) ?

16 Nov 2015

As noted above, I spliced a DMM into the red wire of a hacked USB cable to measure milliamps.

Yes, the SDA is the pk20dx128vfm5, and its data sheet suggests 17ma.

16 Nov 2015

I don't know which LDOs they have on there, but crappy ones (like an 7805) can consume multiple mA's. And if you got multiple LDOs, that can be a significant part.

When you mention LEDs, I assume you mean the status LEDs? They won't consume that much (at least I don't think they do). But the RGB LED can also consume tens of mA's.

09 Dec 2015

Hi all, i'm facing the same questions.

With the board powered via VIN pin (5V) i have a 113mA current which drops down to 79mA (approximately ) in BLPI+VLPR/VLPW/VLPS, that's very far from K64F VLP specs in datasheet.

Is there software way to disable all the unused hw and take more accurate measures?

09 Dec 2015

J20 is the MCU current measure connector (P3V3_K64F), you will need to remove R64 (0ohm) if fitted then attach a ammeter across the connector. You can then measure the MCU power.

J17 is the Ethernet current measure connector (VDDIO_ENET), again you will need to remove R60 (0ohm) if fitted.

There are other power link options, see the schematic here:

https://developer.mbed.org/media/uploads/sam_grove/spf-28163_d.pdf

However bear in mind there are devices attached to the MCU, If these are not powered they may have a leakage effect through the port connections depending how they are configured and can range in the mA's particularly on some i2c devices.

The power consumption levels stated in the manual are given assuming no other device is attached (MCU only) and certain internal peripheral parts are not being used or have been activated.

30 Mar 2016

Hello,

I've been testing low power modes of K64 MCU on FRDM-K64 board. I powered the board from J24 (with 6VDC). Without the USB SDA connected. So, on this scheme, the K20 is unpowered. Doing so, I measured current on J20, this is MCU consumption, and measured the system current on the power supply at the same time.

I reached to the following measurements in the different operation modes

MCU / FRDM

(RUN) 35.5mA / 115mA

(WAIT) 23.2mA / 100mA

(STOP) 524uA / 79mA

(VLPR) 1660uA / 80mA

(VLPW) 1250uA / 79mA

(VLPS)110uA / 79mA

(LLS) 6uA / 79mA

(VLLS0) 2uA / 79mA

(VLLS1) 2uA / 79mA

(VLLS2) 4uA / 79mA

(VLLS3) 6uA / 79mA

Is there a way to reduce the power consumption of the board? I understand that PHY consumes 40mA aprox and it provides the clock signal. Is it possible to deactivate the rest of its functionality provided that I m not going to use Ethernet in order to minimize its consumption?

Best regards, Matias

17 Apr 2016

Hi Matias,

Did you ever find a solution to your problem? I also took similar measurements and got the same results.

Thanks,

Damien

18 Apr 2016

Hi Everyone,

There must be a way to power down the PHY while keeping the clock active. If you look at Table 7 (see pasted image below) in the datasheet for the KSZ8081RN (the PHY chip) chip, there are two 'power down' modes. One where the software is powered down, and another where the software is powered down and the oscillator is in 'slow oscillator' mode.

I just do not know how to directly set the registers of the KSZ8081RN.

Damien

/media/uploads/defrost/table7.png

28 Apr 2016

Hello Damien.

I removed R60 from the board, this is a 0 Ohm Resistor. This disables the IO block of the PHY and doing so I could reduce the system current in around 25 mA. You may place a Jumper on J17 to recover the IO block functionality.

Regards

Matias

06 May 2016

Hello Damien,

In order to communicate the K64 with the PHY chip (KSZ8081) you have to use the RMII interface. This is very easy to implement thanks to the processor expert component library "Ethernet_LDD". Please look into this and tell me if you have any problem. This is a peace of code where I set the PHY in power down mode and slow oscilator mode.

/media/uploads/matiasfortinero/peace_of_code.txt

Doing this, you don't need to remove R60.

Regards,

Matias

08 Jun 2016

Hi Matias,

Thanks a lot for this tip. A quick question for you: is there a way to import the "Ethernet_LDD" library into the online mbed compiler? If not, is there a way to access it easily? I've just started to download CodeWarrior, hoping this will contains the right libraries.

Thanks again,

Damien

08 Aug 2016

With K64 attached to 100mbs Ethernet and doing lwIP UDP, I was seeing 167 ma. I was able to powerdown the PHY by setting bit 11 in reg 0 of the PHY (datasheet pg 27). the power dropped to 51.2 ma; but I think the MCU may have halted as well, since my printf() after the power down never appeared. To talk to the PHY the Ethernet peripheral and clock have to be running. There is a enet_mii_write() in fsl_enet_driver.c, but I used mdio_write from teensy, see https://github.com/PaulStoffregen/k66_ethernet

With no Ether cable and running blink, i'm presently measuring 151ma through the USB cable. Plugging in Ether cable turns on the green RJ45 LED and power goes to 159 ma. Consumption is higher than my first post in this thread.

16 Aug 2016

Hi Tom,

Thanks for your reply. I know that I need to set bit 11 of the 0th register, however my code just doesn't seem to do it. I have tried a very similar method to what you have proposed. I suspect the problem is how I setup the MII interface on the K64F. Therefore, does anyone have a stand-alone function which shuts off the PHY chip for the K64F. Here is my first attempt:

void PowerDownEthInterface(void){
    // Powers down the Ethernet Interface
    unsigned int data = 0;
    unsigned int adr = 0x0; // The address of the PHY is either 0 or 3.
    
    // Configure the pins on the MCU:
    pin_function(PTA5,  4);
    pin_function(PTA12, 4);
    pin_function(PTA13, 4);
    pin_function(PTA14, 4);
    pin_function(PTA15, 4);
    pin_function(PTA16, 4);
    pin_function(PTA17, 4);
    
    // Turn on the ENET clock:
    SIM_SCGC2 |= SIM_SCGC2_ENET_MASK;
    // Set for ENET_MSCR Register:
    data = 0;
    // Increase the hold time on the MDIO output:
    data |= (0x7) << ENET_MSCR_HOLDTIME_SHIFT;
    // Set the MII speed:
    data |= (0x4) << ENET_MSCR_MII_SPEED_SHIFT; // Have also tried 0x4 [for 25 MHz] and 0x9 [for 50 MHz]
    // Save the register:
    ENET_MSCR = data;
    // Enable the ENET:
    ENET_ECR |= ENET_ECR_ETHEREN_MASK;
    // Display some information:
    DBG("ENET_ECR: %d", (unsigned int) ENET_ECR);
    
    // Build up the data register that will be sent to the PHY. This uses information from Section 45.4.6 of the K64P144M120SF5RM datasheet
    
    // Reset the data variable:
    data = 0;
    // Set bits 31 and 30 to 01 for a vlid MII management frame:
    data |= (0x1) << ENET_MMFR_ST_SHIFT;
    // Set the operation code (bits 29-28) to 0b01 = Write frame operation for a valid MII management frame
    data |= (0x1) << ENET_MMFR_OP_SHIFT;
    // Set the address of the PHY device to 0. There can be up to 32 devices.
    data |= (adr) << ENET_MMFR_PA_SHIFT;
    // Set the register address we would like to write to in the PHY. We want to set bit 11 in register 0, therefore set the address here to 0:
    data |= (0x0) << ENET_MMFR_RA_SHIFT;
    // Set the turn around bits to '10' for a valid MII frame:
    data |= (0x2) << ENET_MMFR_TA_SHIFT;
    // Set the data that will be written to the PHY device. For software power down, set bit 11 to 1:
    data |= ((0x1) << 11) << ENET_MMFR_DATA_SHIFT;
    // Clear the MII write interrupt bit (writing a '1' clears the bit):
    ENET_EIR &= ENET_EIR_MII_MASK;
    // Send the data...
    DBG("Writing to ENET_MMFR...");
    // Send the data to the PHY device by writing to the ENET_MMFR register:
    ENET_MMFR = data;
    // Check to see if it completes:
    while((ENET_EIR & ENET_EIR_MII_MASK) == 0);
    // Done!
    DBG("Writing to ENET_MMFR a success!");
    // Put the MII back in a low power state:
    ENET_MSCR = 0;
    // Disable the ENET:
    ENET_ECR |= ENET_ECR_RESET_MASK;
    // Turn off the ENET clock:
    SIM_SCGC2 &= ~SIM_SCGC2_ENET_MASK;
    
    
    return;
}

Thanks,

Damien

24 Nov 2016

Hi Damien,

Did you every get anywhere with this?

Thanks,

Craig

18 Dec 2016

Does anyone have some example code that makes this happen? Matias' code snippet looks awesome, but is incomplete.

01 Feb 2017

I have not made any progress on disabling PHY and keeping the MCU running. For your viewing pleasure, here is coremark power graph showing K64F board consumption vs MCU power (jumper J20), and the Teensy 3.5 board (K64F). /media/uploads/manitou/coremk64a.png

Various MCU coremarkish results at https://github.com/manitou48/DUEZoo/blob/master/perf.txt (at end of file)

09 Dec 2017

Does a complete source code routine or hardware procedure exist to reduce PHY power while keeping the FRDM-K64F operational ? In my experiments either removing R60 or attempting to use code to disable the PHY result in problems with the FRDM-K64F OpenSDA USB debug interface. Current draw does appear lower with R60 removed, however, using an in-line USB current measurement device. Thanks. Wil B.

24 Jul 2019

hey could you please tell me how do you enter the VLPR mode? When i call BOARD_BootClockVLPR, the program works properly