_Sleep()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Alright, I'm still having a hard time trying to reduce power consumption for my program as nothing seems to work how I expect it. I have dropped trying to put the entire device into sleep and I am first going to just stop certain components when I don't need them running. To do this I am using a timer that hits its terminal count every 8 ms, this feeds a counter which will then trigger an interrupt every 128 ms. I use this trigger as a psuedo sleep mode in that when its triggered it alternates a flag, when this flag is high certain parts of my system are on, when it is low everything is off.

   

The problem I am having is that none of my components seem to like to be put to sleep and woken up as they no longer work. The 128 ms on time for them should be plenty of time, so i don't think that is the problem. If anyone could give my code a look through and tell me what I'm doing wrong I would greatly appreciate it.

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

If you followed all the steps described in the AppNote, opening the J10 jumper should power off the PSoC device, when powered by USB only (only the debug circuit should be active, including LED D5).

   

Or maybe I understand you wrong. What should happen, if you did everything correctly, is:

   
        
  • when you power the board by Vbat only, removing J10 disabled the debugging circuit, but the PSoC3 should work properly
  •     
  • closing J10 powers the debugging circuit to, and this is what you measure on J10
  •     
  • connecting the USB port for debugging, with J10 open, enables debugging, but won't power the PSoC3 (it is still powered by the boost circuit)
  •     
  • connecting the USB port for debugging, with J10 closed, will power the PSoC3 by boost and by USB (I'm not sure who will win in that case)
  •     
  • connecting the USB port for debugging, and no voltage on Vbat, will react to J10: closed=PSoC3 is running, open=PSoC3 is down
  •    
   

From the schematic, it doesn't seem possible to measure the pure PSoC power consumption when using the boost converter. But since you should have separated the power domains, you can measure what goes into Vbat, and when opening J10 this is the pure power consumption you can expect.

View solution in original post

0 Likes
29 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Just as a FYI, this reference covers sleep operation, partial and complete,

   

with recomendations on module prep for sleep -

   

 

   

http://www.mymcu.ru/content/articles/Cypress/AN66083.pdf

   

 

   

Another thread -

   

 

   

http://www.psocdeveloper.com/forums/viewtopic.php?f=42&t=7229

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

I have gone through that application note a few times now, also I am no longer putting the device into sleep, just different components. I have found that apparantly IPGAs and PGAs should NOT be put to sleep, just stopped; so any configuration saving has to be done manually. Once I changed that I now get my amplified pulse. 

0 Likes
Anonymous
Not applicable

Also, the _Stop() should not be called for IPGAs and PGAs so the best way to reduce their power consumption is to change the power option in its configuration.

0 Likes
Anonymous
Not applicable

Using the info in Appendix B here: http://www.cypress.com/?docID=37054

   

I setup my PSoC 3 dev kit so that I could measure its power consumption.

   

I am the following code:

   

#include <device.h>

void main()
{
    BoostConv_Start();
   
    while(1)
    {

    }
}
 

   

In the top design I just have the Boost Converter block configured to operate down to 2.1 V and supply 5 V using a 400 kHz frequency. I have the IMO set at 3 MHz and the PLL set at 24 MHz I then divide down so that the master and BUS clock are both 3 MHz. There are no connections at any of the pins. I am powering the board with 2 D-Cell batteries in series.

   

When I measure the current according to the instructions in Appendix B I see that the board draws 36.5 mA

   

This seems way to high for having code drives no load, does no computation or anything of the sort. Can anyone explain to me why I am measuring this much current?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

That is even more than the specified 23mA for a PSoC3 running at 66MHz. Are you darn sure that there is not anything drawing current on your board? Which silicon revision are you using? If it is an ES, it may (will) not conform to the specs.

   

I warn you to try to cut off VCC from the chip, because applying a (small) voltage to the unpowered chip could destroy it.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I am not 100% sure no. I followed the instructions listed above so I know that the RS-232 isn't getting power, nor is R56. Other than that I do not know what is getting power and what isn't, according to those instructions it should be just the PSoC.

   

My PSoC chip does not have an ES number on it, it only reads:

   

CY8C3866AXI-

   

040 1107

   

A  04 608681

   

According to the knowledge base this means it is a production silicon

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Assuming you've got a kit-030 i cannot see how the USB-chip cy7c68013 is disconnected from power (maybe I've overlooked something. Are you measuring power with the LCD-module plugged off and no USB-Connection? Sorry, dumb question, but is the green led lit??

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Assuming you are not using the boost circuit you should see attached,

   

so something else is drawing power.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I must be blind, I see you are using Boost. That being said the

   

efficiency graphs indicate > 50%, so you are still exceeding the

   

2X that implies to the main power specs.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

I am using the boost circuit, however in active it should only draw about 200 uA.

   

"The boost typically draws 200 μA in active mode and 12 μA in
standby mode."

   

I have the USB unplugged as I'm powering the device using the boost. The LCD module is unplugged.

   

Jumper J10 has been disconnected and I am measuring current from the far right pin of J10 (5 V) to the center pin (GND)

   

The LED (D5) comes on when I make the above connection with the multimeter.

   

You are correct, I am using Cy8CKIT-030, I do not know how to disconnect the USB chip from power either, could this be causing my excessive current draw?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When the green LED goes on, it will draw some mA and all devices, be it an R or an USB-chip may be connected to power as well.

   

I do not want to tell you something wrong, so I suggest you get the schematics of the board (from the CD) and compare (measure) if all is right. In my schematics there is a zero-ohms resistor R9 supplying power to the USB-chip. The alterations on your kit tend to get complicated, there have been some posts regarding a PSoC3 board, but i don't know whether your needed boost circuitry was implemented there

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I too have a 0 ohm resistor R9, however I'm hesitant to remove that as in doing so would prevent me from programming to the device. Is there any way I can figure out what all is being powered and with how much current so that I can deduce how much current the PSoC itself requires?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yes,

   

a) look into the schematic

   

b) file a technical case and state that the LED at least is lighted (or lit?)  and that this fact does not confirm to measuring the current the PSoC draws.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

@bob: J10, which used as measurement point, separates the VDDA from the 5V (or 3.3V) net. The USB chip is powered by the 3.3V rail, so it is not included in the measurement.

   

@ip7: you say you are using the boost converter. Does this mean that you power your circuit via the Vbat test point? Did you load all the components needed for that (R25, R29, R31)? When I read the schematic right, this powers the VDDD and VDDA rails directly (and not via J10). When you then measure the current on J10, you measure then current flowing from the boost converter to the rest of the circuit, including the LED D5 and the USB circuit (I'n not sure how much curent this draws: when connected as USB FS device it needs 35mA, but you said it is not connected. But OTOH the USB chips is prevented from suspend mode by pulling its wakeup pin high)

   

So try powering it via USB or 9V battery, and measure the current on J10. This should give you proper results. (and if it doesn, you found a bug in AN77900 - time for some feedback 🙂

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

OTOH = On The Other sHide????

   

I was sure something is pretty wrong when D5 started to consume current...

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Yes, I do power the kit via the Vbat test point. I have followed the steps in the user guide to setup the boost converter and it functions properly.

   

If I plug in the USB the device is on and simply disconnecting J10 does not cut he power so I can't measure the current here safely as it is no longer in series, is that right?

   

Also I need to measure the power consumption with the boost converter being used if that is at all possible.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

OTOH=On The Other Hand 🙂

   

There is one of the derivates of Murphy's law, stating: "if anything else fails, read the manual". So you got it right, I was just faster with looking at the schematics 🙂

0 Likes
Anonymous
Not applicable

The followoing section of the AN77900 describes the modifications that needs to be done to measure current on a 030 Kit. Although you might have already configured as below, cross check!

   

 

   

CY8CKIT-030 and CY8CKIT-050 Modifications

   

 The configuration described here uses a single power rail for Vddd, Vdda, and Vddio. Power is measured by placing a meter in series with the PSoC‟s Vddd pins.

   

1. Remove R23. This separates the VDDA net from the VDDA_P net.

   

2. Add a zero-ohm resistor to the pads for R30. This ties VDDD to VDDA so that you can measure the total current consumed by the PSoC.

   

3. Remove R58. This separates the RS-232 driver U8 from VDDA. By default, U8 is powered by VDDA, so it will show up in your power measurement.

   

4. If RS-232 is needed, short pin 2 of J37 (above the “J37” text) to the VDDA_P test point. This powers the RS-232 driver from VDDA_P instead of VDDA so that it will not show up in your power measurements.

   

5. Remove the jumper from J30. By default, R56 is powered by VDDA, so it will show up in your power measurement.

   

6. Short pin 2 of J30 (below the “J30” text) to the VDDA_P test point. This powers the potentiometer R56 from VDDA_P.

   

7. Remove the jumper from J10.

   

8. Connect the LOW side lead from the multimeter to the center pin of J10.

   

9. Connect the HIGH side lead from the multimeter to one of the outside pins (for 5-V or 3.3-V operation) of J10.

   

After these modifications are made, the total current drawn by the PSoC can be accurately measured. All the other components on the DVK board are powered separately from Vddd, so they will not be seen in your power measurements. The DVK can be configured for 5-V or 3.3-V operation without any further changes by using J10 and J11.

   

 

   

Thanks,

   

srim

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

If you followed all the steps described in the AppNote, opening the J10 jumper should power off the PSoC device, when powered by USB only (only the debug circuit should be active, including LED D5).

   

Or maybe I understand you wrong. What should happen, if you did everything correctly, is:

   
        
  • when you power the board by Vbat only, removing J10 disabled the debugging circuit, but the PSoC3 should work properly
  •     
  • closing J10 powers the debugging circuit to, and this is what you measure on J10
  •     
  • connecting the USB port for debugging, with J10 open, enables debugging, but won't power the PSoC3 (it is still powered by the boost circuit)
  •     
  • connecting the USB port for debugging, with J10 closed, will power the PSoC3 by boost and by USB (I'm not sure who will win in that case)
  •     
  • connecting the USB port for debugging, and no voltage on Vbat, will react to J10: closed=PSoC3 is running, open=PSoC3 is down
  •    
   

From the schematic, it doesn't seem possible to measure the pure PSoC power consumption when using the boost converter. But since you should have separated the power domains, you can measure what goes into Vbat, and when opening J10 this is the pure power consumption you can expect.

0 Likes
Anonymous
Not applicable

Ok, I didn't realize that D5 was representing power to the debugging circuit, I had just assumed it was power to the PSoC.

   

So measuring the current in series with my battery to the Vbat test point with J10 unconnected and the USB unconnected I measure 5.5 mA. That is a much better reading and is something I can actually work with.

   

Thank you all so much.

0 Likes
Anonymous
Not applicable

Is there a way to add the LCD to this power consumption measurement. Looking at the schematic it looks as though I can connect R71 to VDDA which will supply the 3.3 V to the LCD however this seems to also turn on the debugging circuit as signaled by D5.

   

Running just off of the boost converter I notice none of the 5V or 3.3V pins on the devkit are powered so I can't simply draw from there. Is there anything you guys can think of?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You will need to remove R71, and can the connect Vlcd (the middle pad between R71 and R72) to Vddd (or Vdda). The boost converter drives Vdda and Vddd, but not the 5V and 3V3 lines.

0 Likes
Anonymous
Not applicable

When I connect that point to VDDA it also turns on the debug stuff.

   

Do you mean I should connect it to J11 instead of the VDDA test point?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Thats strange. AN77900 explicitely talks about how to separate the two Vdda nets (Vdda and Vdda_P). And you did remove R71 before? (Otherwise you connect Vdda to the 5V net). The Vlcd net is not connected to anything else - but maybe you can verify that?

0 Likes
Anonymous
Not applicable

I have not removed R71, but R72 is disconnected so I shouldn't be connecting VDDA to the 5V through that connection.

   

I did already seperate VDDA and VDDA_P by removing R23.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

If R71 is still in plave, Vlcd is connected to the 5V net. If you connect then Vlcd to Vdda (or Vddd) to power it by the boost converter, you have connected the boost converter to the 5V net. And then you power the whole debugging stuff.

   

What the modifications in AN77900 do is to connect Vdda and Vddd, and separate them from the whole 5V, 3V3, Vdda_p and Vddd_p nets. The only connection between them is then the J10 jumper, which can be used for measuring the current. But you need to be careful not to create other connections between these separate nets.

Anonymous
Not applicable

So when I run the program and the device is powered off of the USB the following code executes within 120 ms

   

Pin_1_Write(0);                                    //
 Wake_Write(1);
LCD_Position(0,0);                                //
 LCD_PrintString(LCD_Buffer[menuIndex][0]);        //
LCD_Position(1,0);                                //
 LCD_PrintString(LCD_Buffer[menuIndex][1]);        //

   

However when powered off of the boost converter the above code takes about 280 ms

   

If it took this long with both modes of being powered I would assume it to be some coding error, but I only see it when I am powered via boost converter. Is there a possibility that the boost converter makes the LCD slower? I have noticed that Vlcd is only 3.16V when boost powered and it is 3.79V when USB powered (this is coming off of VDDA), could this be the reason as to why the LCD is slow?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Without looking at the data sheet, some ideas are:

   
        
  • the boost converter might need some internal resources, which can slow down the program (not according to its data sheet)
  •     
  • the lower voltage can affect the core frequency, or maybe the read timings of the flash
  •    
   

(But I think both should not really happen) Did you setup yout program to use 3.3V?

   

You can try to power to PSoC directly via J1o (middle pin), without the boost converter enabled, and look how it reacts to changes in the voltage.

0 Likes
Anonymous
Not applicable

Turns out I did have a button connected to the 5V pin in the prototyping area, so when powered off of boost converter my button register was returning an invalid value.

   

Connecting this button instead to VCCA in the prototyping area fixed my problems, although I have not quite figured out why that changed the duration of that code. Maybe not properly handling an invalid value on my button register? I'm sure I'll figure it out later.

   

Again, thanks hli for your help.

0 Likes