cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

Hi there

   

I am currently trying to optimize the power consumption of my PRoC module mounted on the Pioneer board.

   

Regarding this I stumbled upon this thread: http://www.cypress.com/forum/psoc-4-ble/psoc-4-ble-spi-current-measurement

   

I checked the linked application notes with no result.

   

With my current understanding this code fragment should put the SPI component in the lowest possible power mode, but it is still drawing around 170uA.

   
int main() {          SPI1_Init();     CyDelay(100);     SPI1_Sleep();     CySysClkEcoStop();         CySysPmDeepSleep();     while(1);  ....  }
   

The only way I was able to lower the current is by calling <pin_name>_setDriveMode() for the MISO, MOSI and SCLK pins and setting them to analog high impedance, but that seems not like a proper way to do it.

   

Thanks

   

Jonas

0 Likes
Reply
5 Replies
Anonymous
Not applicable

Is 170uA really the lowest I can expect?

0 Likes
Reply
JoMe_264151
Expert II

Welcome in the forum, Jonas!

   

setting them to analog high impedance, but that seems not like a proper way to do it.

   

This is the proper way! When in deep sleep the pins output states are still maintained (could be to prevent the 30t crane to move)

   

SPI_Sleep() just saves the current state of the component, so that it can be restored when woken up. Setting the pins to an appropriate state (in your case hi-z) is your task to do.

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Excellent! I was not sure about that because your code takes great care of pin configuration so far, so I expected that would be included in the SPI code, but it makes more sense this way.

   

Now where do I find the code which initializes the pins to their default configuration?

   

I was unable to identify which code is called at start up to setup the IO as configured in .cysch file (or is that part in the bitstream?). So I know which mode to set when I have to use the SPI again. I also looked into the documentation and did not find information about the configuration of the pins.

   

Thanks

   

Jonas

0 Likes
Reply
JoMe_264151
Expert II

Use SPI1_miso_m_Sleep() and SPI1_miso_m_Wakeup();, same for mosi. I admit that the documentation is thin here...

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Thanks for helping me out!

   

For anybody having the same problem: Sleep, SetDriveMode & Wakeup did the trick for me.

0 Likes
Reply