how can I decrease  the consumption in ModeStop?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how can I decrease  the consumption in ModeStop?

1,085 Views
néfiarmelim
Contributor II

I am using the processor expert in my project and I aplly this code with MCF51EM256:

 

while(1){

 

TEMPO_STOP2 = 5;

.

.

.

My code

.

.

.

//#_RTC_###########################################################//

RELOGIO_GetTime(&Time_RTC);
RELOGIO_GetDate(&Date_RTC);

HOR_ATUAL = Time_RTC.Hour;
MIN_ATUAL = Time_RTC.Min;
SEG_ATUAL = Time_RTC.Sec;
ANO_ATUAL = Date_RTC.Year;
MES_ATUAL = Date_RTC.Month;
DIA_ATUAL = Date_RTC.Day;

 

MIN_ATUAL = MIN_ATUAL + TEMPO_STOP2;

if(MIN_ATUAL >= 60){
MIN_ATUAL = MIN_ATUAL - 60;
HOR_ATUAL = HOR_ATUAL + 1;
if(HOR_ATUAL >= 24)
HOR_ATUAL = HOR_ATUAL - 24;
}

 

RELOGIO_SetAlarm(HOR_ATUAL,MIN_ATUAL,SEG_ATUAL);

LED_BATERIA_ClrVal();
LED_TRANSMISSAO_ClrVal();
ON_OFF_REG_ClrVal();
ON_OFF_IST_ClrVal();
UART_RADIO_Disable();
I2C1_Disable();
BATERIA_Disable();
ON_SLEEP_RADIO_ClrVal();
TEMPO_Disable();
MicroControlador_DisableInt();

MicroControlador_SetStopMode();

 

MicroControlador_EnableInt();
TEMPO_Enable();
ON_OFF_REG_SetVal();
UART_RADIO_Enable();
ON_OFF_IST_SetVal();
I2C1_Enable();
BATERIA_Enable();
ON_SLEEP_RADIO_SetVal();

 

//###########################################################//

}

 

I already configured:

 

Stop instruction enable = yes
Partial Power down mode = Enabled
Internal clock in stop mode = Disabled
External clock in stop mode = Disabled

 

But my current in MCF51EM is about 1mA...

When I hope about 0,5uA as say the datasheet.

 

"...Stop2 mode supply current 0,576uA in Table 11. Supply Current Characteristics..."

 

What can I do to have this consumption?

 

BEST REGARDS

Labels (1)
8 Replies

846 Views
néfiarmelim
Contributor II

hi tom,

Thank very much for your help.

I have only MCF51EM and the regulator 3V3 in my board.

So, I'm looking for improve my firmware.

It works with RTC to wake up, and It's right and return.

The only problem is the consumption.

I tried to use AN3460, AN3387 and AN441 as reference
but never I got 500nA in serie with the pin 54 (VCC).

It's about 1mA ...

If I get improve it, I'm going to post here.

I am grateful for your help.

Lucas

0 Kudos

846 Views
TomE
Specialist II

> It works with RTC to wake up, and It's right and return.

Are you sure it is using STOP Mode 2? Prove it.

If you are using STOP mode 2 then it must be recovering from RESET and starting again from reset. Show me some of the generated code that does that.

Try writing some code that has the CPU run at full speed for (say) 10 seconds with some output (like a GPIO) set high to show it is running like that, then set the GPIO low and then STOP while having the RTC wake you up in 10 seconds or a minute or something. Make sure it stays "asleep" for that long. Compare the current when it is "running" with when it is supposed to be in that deep sleep. I don't think it is setup properly to sleep. You may be relying on Processor Expert to get this all right for you, but there may be some other programming you have to do to make that work.

When in power saving mode, you have to have ALL pins on the chip (all GPIO pins, and since you've disabled all peripherals, all of their pins revert to being GPIO) either with pullups, pulldowns, or programmed as OUTPUTS. If you have any floating inputs, then they will draw a lot of current. AN3460 "5.2.3 Unused Pins" details this.

Tom

0 Kudos

846 Views
TomE
Specialist II

You should download this and see what you can learn about "ultra low power systems".

Kinetis Power Estimation Tool|NXP 

It might help with your current work, or you may decide to change to a newer chip that has better support for ultra low power operation.

Tom

0 Kudos

846 Views
TomE
Specialist II

How are you powering your board? From a lithium battery? From a 3V button cell? From two 1.5V Alkaline batteries? A Coin cell is only rated at 4mA Maximum (and 20mA Pulse) and the CPU pulls 80mA at full speed. You'd have to limit it to 1 MHz to get anywhere near that, ignoring all peripherals.

> MicroControlador_DisableInt();
> MicroControlador_SetStopMode();

> MicroControlador_EnableInt();

I have no idea what those functions do, and I don't think those functions were generated by any Freescale code generators (as they're not in English).

I don't think they'll work unless there is some very complicated code in the "SetStopMode()" function.

Because STOP2 MODE does not return.

6.8.1 Stop2 Mode

Exit from stop2 is performed by driving the wake-up pin (RESET and PTA0/RGPIO0/IRQ/CLKOUT) on
the MCU to zero.

Upon wakeup from stop2 mode, the MCU starts up as from a power-on reset (POR):

So you'll need to put some special "signatures" in RAM, or perform a full "context save" to RAM, and then check and restore that context out of Reset.

WAIT, LPWAIT, STOP3 and STOP4 return (keep going from after the STOP instruction) but STOP2 doesn't. Does that do what you want or should you be using one of the other modes?

Tom

0 Kudos

846 Views
TomE
Specialist II

First an admission. I've never use that chip or any MCF51 variant. I've only every used power hungry Coldfire chips running at the full clock rate with lots of external memory and over 100kW of internal combustion power available. I've never used Code Warrior or Processor Expert, so there's no use asking me about anything specific to those, because there's no way I can answer.

But I understand electronics, processors and "know where the electrons go". I've also managed to get an 8-bit ST chip running with a 4MHz crystal down to 250uW, and the experience of that has taught me well.

Assuming nobody else with the proper direct experience of getting these chips down to microwatt levels chimes in, I'll try to help.

> What can I do to have this consumption?

You have to work out from your design and data sheets and by actual detailed measurement where the current is going. There's no quick and easy path. This is real Engineering.

You could also start off with a documented reference design from the manufacturer that already achieves the power consumption you want. That should be the first stage in selecting a CPU if you want it to be easy.

Are you measuring 1mA as the current consumption of your entire board, or do you have current shunts in the supply to the CPU, and are measuring 1mA there?

You have to provide far better details of what you're measuring and how you're measuring it. Providing code doesn't help at all. Providing the register contents of the power control registers would be a good start to prove you're doing the right things. Prove you're following "Table 6-1. CPU / Power Mode Selections".

If the 1mA is the whole board, then your voltage regulator could be drawing that much. If you have a zener across the power supply, then those things leak milliamps, even at half their rated voltages. Zeners aren't actually zeners under 14V or so. What other parts do you have on the board and what do they draw? Do you have any LEDs on the board? They can cause a high current draw if you shine light on them. Yes, really.

You can't measure low power if you have a debugger connected. Low power is extremely hard to debug because none of the usual tools that help with debugging will work.

Prove with an oscilloscope that you've succeeded in stopping the clock.

How are you intending to wake from Stop-2? That might require external hardware that probably draws some power. Are you intending to use the IRTC to wake up? The IRTC has to run from Vbat for that.

Tom

0 Kudos

846 Views
néfiarmelim
Contributor II

I moved and now can you help me?

0 Kudos

846 Views
néfiarmelim
Contributor II

LVD moule  is not enable in stop mode;

Target BDM is not attached;

Fang Li

0 Kudos

846 Views
TomE
Specialist II

Fang Li, Nefi asked a closely related question to this back in September on the Coldfire Forum.

SetStopMode 

Please consider moving this issue there. It doesn't belong in this "Using NXP Forum" Community.

Neither do any of the other 32 posts in November belong here either!

Nefi, you can move this to the right forum yourself. Under "Action" at the top right, select "Move", then "Spaces" then select the "Coldfire" one.

Tom