Other Parts Discussed in Thread: EK-TM4C1294XL, CC3100, TPS63020, BQ25892
Tool/software: TI-RTOS
Hi everyone,
I hope you are doing fine.
I am working on energy optimizations in a project and i am using different techniques to get the most out of instrument battery run time. I have tried and tested different MCU clock frequencies, between 30 MHz and 120 MHz, with external 25 MHz crystal oscillator while monitoring MCU current consumption. At lower frequencies, the MCU current consumption drops down fairly. Along with that, i am trying to save even more energy by checking the Ethernet cable connection, for Web server use, and if cable is not connected, i am powering off the Ethernet PHY. I must mention here that i am using TM4C integrated PHY. Every 5 seconds, my code powers ON the PHY and checks if cable is connected. If yes, it does not power OFF the PHY. However, there is one limitation here that i am observing. After powering ON the PHY, it takes about 1600 milli seconds for the connected cable to be detected, both at 30 MHz and at 120 MHz. This cable detection seems to have no relation with MCU clock frequency. Due to this 1600 milliseconds delay when PHY is in powered ON state, the consumed energy graph rises. Given below is the code that i am using for this purpose. Please have a look at i and also the questions i have listed below. Thanks in advanced to everyone who interacts with this post.
// Get emac PHY powered OFF status
emacPhyBmcr = EMACPHYRead(EMAC0_BASE, 0u, EPHY_BMCR);
// If emac PHY is powered OFF
if(emacPhyBmcr & EPHY_BMCR_PWRDWN)
{
// Power it ON
EMACPHYPowerOn(EMAC0_BASE, 0u);
GPIOPinWrite(GPIO_PORTQ_BASE, GPIO_PIN_4, GPIO_PIN_4);
SysCtlDelay(40000u*emacDelay);
GPIOPinWrite(GPIO_PORTQ_BASE, GPIO_PIN_4, 0);
}
// Wait while emac PHY is powered ON
while(EMACPHYRead(EMAC0_BASE, 0u,EPHY_BMCR) & EPHY_BMCR_PWRDWN)
{
}
// Get emac link status
emacIsLinkUp = EMACSnow_isLinkUp();
// Check if cable is connected
if(emacIsLinkUp == false)
{
// Power it ON
EMACPHYPowerOff(EMAC0_BASE, 0u);
}
I must also mention that i am using TI RTOS NDK for Ethernet client. In code given above, i am toggling PQ4 to measure the delay after which the connected cable is detected after PHY is powered ON from powered OFF state. Please have a look at questions listed below.
(i) Is there any step that i may be missing that will eliminate the 1600 ms delay for cable detection?
(ii) Will there be any loss to Ethernet PHY registers configuration due to this power ON power OFF cycle?
(iii) If anyone has worked on TM4C energy optimization, can you please share your experience?
Thanks,
Muhammad Shuaib