Pmu

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

Pmu

550 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by straw_hat on Thu Jul 21 17:44:41 MST 2011
hello.

Please can you help me about pmu..my problems is that  want to enter deep sleep mode in lpc1343 and wake it up using one on the timer (timer16B1) but the debugger will stop working when the deep sleep mode is entered. I am using the lpcxpresso base board and and keil debugger. please can anyone help me or give me suggestions. thanks
0 Kudos
9 Replies

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by straw_hat on Mon Aug 01 01:18:20 MST 2011
yeah thanks Rob. I was able to get my board working:D. One more question, is there any significant difference between timer16B1 and timer16B0?? Because in the sample code from nxp, it uses the timer16B0 match 0 in waking up the mcu, but I believe that there no really significant difference between the two timers, so what I did was I edited the code and replace the wake up pin for start logic to timer16B1 match 0. The result is that the MCU wont wake up. please can you help me be clarified?? thanks:):)
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Jul 25 03:30:22 MST 2011
Did you try to pull the ISP pin down during reset?
That should put the controller in ISP mode.

Rob
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by straw_hat on Mon Jul 25 00:41:57 MST 2011
Hi.

Thanks for the replies. I already able to get an example from nxp regarding the self wake up. But now my problem is that I was not able to put the board into ISP mode and now my MCU is like a dumb continuously executing the sleep wake up task. Is there anyway that I can erase the flash. I already tried the flash magic but when i start erasing it say failed to autobaud. thanks
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Sat Jul 23 06:27:20 MST 2011
Hello Rob,

I think it is a good suggestion using power consumption ... although (in practice) current measurements done by using a (normal) DMM, differences in measuring 30uA (deep sleep) and 0.22uA (deep power down) are hard to notice.

In sleep mode (see datasheet) the core clock is switched off, no dynamic power can be used, but the peripheral stays intact ... so when the led is 'on', it stays 'on'.

Needless to say that your pcb board need to be prepared in such a way that only the current to the controller is measured and not the rest of the board.
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Fri Jul 22 21:55:24 MST 2011

Quote: NXP_Europe
use a 'HeartBeat' led ... put this sub-routine somewhere in de main.



This will only prove that you are not in Kansas anymore.
It does not tell you if you found the yellow brick road or that clicking your heels will get you back home again.
A failing heartbeat will only tell you the sub-routine was stopped.

If you want to know if you're on the right way to Emerald City there is only one thing you can do; measure power consumption.
Actually there are two ways. One is implemented by NXP in the example code :eek: and that is the clock out pin. As soon as there is no signal on the clock out pin then you can be reasonably sure that the clock to the core is stopped.

The heartbeat LED will no tell the difference between sleep, deep sleep, and deep power down modes. And in both deep sleep and deep power down modes you clock is stopped.
The only way to tell for sure if your power consumption goals are reached is by measuring the current through the device. And that will also show you the difference in power between sleep and deep sleep modes.

Rob
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Fri Jul 22 17:36:34 MST 2011
Hello straw_hat,

use a 'HeartBeat' led ... put this sub-routine somewhere in de main.
When the normal active mode is 'on', the led is blinking. When the controller is in DeepSleep, the led is off.
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Fri Jul 22 01:18:01 MST 2011

Quote: straw_hat
right now i dont have any idea how to do it and also im just a newbie in embedded system.


If I ask a simple question you might discover the answer yourself.

Why do you want the MCU to go into DeepSleep mode?

power consumption!

So just power your LPCXpresso board (not the LPC-Link section, only power via the 3.3V input of the pin header) ad measure the current.
But do remember that you should apply power to the LPC-Link section or have the LPC-Link USB attached to your PC because that will take up power and prevent the MCU from preserving power.

Regards,

Rob
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by straw_hat on Fri Jul 22 01:00:15 MST 2011
thanks for the reply Rob. right now i have a code to make the mcu sleep and awake it. the only thing is that i dont know if it is really working the way it should be because when i start executing, the keil debugger will stop working because the mcu will sleep. how can i confirm that the program is working:confused:. right now i dont have any idea how to do it and also im just a newbie in embedded system.
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Thu Jul 21 23:22:45 MST 2011
The user manual is your big friend (or foe ...)

Read as much as you can about the different power modes.
The differ a lot in the way in which different peripherals are powered and clocked:


Quote:
3.8.3.1 Power configuration in Deep-sleep mode[INDENT] Power consumption in Deep-sleep mode is determined by the Deep-sleep power configuration setting in the PDSLEEPCFG (Table 50) register:
• [COLOR=Red][B]The only clock source available in Deep-sleep mode is the watchdog oscillator.[/B][/COLOR] The watchdog oscillator can be left running in Deep-sleep mode if required for timer-controlled wake-up (see Section 3.9.3). [B][COLOR=Red]All other clock sources (the IRC and system oscillator) and the system PLL are shut down.[/COLOR][/B] The watchdog oscillator analog output frequency must be set to the lowest value of its analog cock output (bits FREQSEL in the WDTOSCCTRL = 0001, see Table 13).
• The BOD circuit can be left running in Deep-sleep mode if required by the application.
• If the watchdog oscillator is running in Deep-sleep mode, only the watchdog timer or one of the general-purpose timers should be enabled in SYSAHBCLKCTRL register to minimize power consumption.[/INDENT]

And knowing that the peripherals in the lpc13xx are (almost all) the same as the ones in the lpc11xx, you could have a look at the lpc11xx examples.
Yes I know ... it would have been so much nicer if NXP had a consistent set of examples for all the different chips :eek:

Check out the timedwakeup example in examples/NXP/LPC11xx/NXP_LPCXpresso1114-301_2011-01-27.zip in the LPCXpresso 4.0.5 release. That project contains an example of how to enter DeepSleep mode and wake up from it using TMR16B0.
You have to read the UM at least twice ... First start reading chapters 3 and 4 but don't try to understand everything at once, just read it and take notice of the global idea of the system. Then read the C-code in the example and check out the specific registers that are being used.
With a bit of luck you'll wake up from a zombie like reading mode (at least that's what happens to me most of the times :D) and your lpc13xx will sleep happily until woken by the alarm.

I have not looked at this in detail myself (yet) but as far as I can see TMR16B0 is programmed to set P0.8 on a match, the NVIC is programmed to generate an IRQ on P0.8, the timer is started, main clock changed to the watchdog oscillator and DeepSleep is entered.
After this the timer (running from the slow watch dog oscillator) will set P0.8 and this will trigger the IRQ handler.

This is also described in section 3.9 of the UM.
Apparently it is not possible to use the interrupt register of the timer since that does not trigger the start logic to enable some needed clocks (I think).

Regards,

Rob
0 Kudos