EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

LPC901 Total Power Down Mode + Keypad Interrupt

Started by ow_tong_peow February 1, 2005

Hi,

I am using LPC901 with external 32khz watch crystal. After
startup, I enable the KBI, and then the uP goes into Total Power Down
mode. It is consuming about 3uA.

Then I trigger the Keypad Interrupt, the timing for uP to wake up
took about 2 seconds.

Then, I test it again with IDLE mode, the uP wakes up almost
immediately after a Keypad interrupt.

Then I configure it to run using IRC, with Total Power Down mode.
The uP wakes up almost immediately when there is keypad interrupt. It
also wakes up when I used the Watchdog oscillator.

Datasheet indicate oscillator stability after power down is 1024
clocks. This is about 30ms only.

1) Why is it that external 32kHz clock took 2 seconds?

2) Has anyone do a Total Power Down mode with LPC901/2/3 before?

Ow Tong Peow


Ahhh, the old watch crystal startup problem. I could tell you a bit about it but expect at least a second or more before it stabilises. When it comes to low-current watch crystals it probably pays to read some app notes on RTCs. Note this link -  http://www.maxim-ic.com/appnotes.cfm/appnote_number/617

Specifically this section:-

Oscillator Startup

Most low-current RTCs exhibit a startup time from 5 to 10 seconds depending on supply voltage and temperature. *Peter*

ow_tong_peow wrote:
Hi,
I am using LPC901 with external 32khz watch crystal. After
startup, I enable the KBI, and then the uP goes into Total Power Down
mode. It is consuming about 3uA.
Then I trigger the Keypad Interrupt, the timing for uP to wake up
took about 2 seconds.
Then, I test it again with IDLE mode, the uP wakes up almost
immediately after a Keypad interrupt.
Then I configure it to run using IRC, with Total Power Down mode. The uP wakes
up almost immediately when there is keypad interrupt. It
also wakes up when I used the Watchdog oscillator.
Datasheet indicate oscillator stability after power down is 1024
clocks. This is about 30ms only.
1) Why is it that external 32kHz clock took 2 seconds? 2) Has anyone do a Total
Power Down mode with LPC901/2/3 before?
Ow Tong Peow

Thanks Peter. I certainly doesn't know this before. Bad low current
watch crystal!!

If I replaced it with a normal 32kHz crystal, will the wakeup time
improve? Better to know before rushing to the Electronics store to
get it. I am trying to get a response time in 100ms or less.

Thanks,
Ow Tong Peow

--- In lpc900_users@lpc9..., Peter Jakacki <peterjak@t...>
wrote:
> Ahhh, the old watch crystal startup problem. I could tell you a bit
> about it but expect at least a second or more before it stabilises.
When
> it comes to low-current watch crystals it probably pays to read
some app
> notes on RTCs. Note this link -
> http://www.maxim-ic.com/appnotes.cfm/appnote_number/617
>
> Specifically this section:-
>
> *Oscillator Startup*
>
> Most low-current RTCs exhibit a startup time from 5 to 10 seconds
> depending on supply voltage and temperature. > *Peter*
>
> ow_tong_peow wrote:
>
> >Hi,
> >
> > I am using LPC901 with external 32khz watch crystal. After
> >startup, I enable the KBI, and then the uP goes into Total Power
Down
> >mode. It is consuming about 3uA.
> >
> > Then I trigger the Keypad Interrupt, the timing for uP to wake
up
> >took about 2 seconds.
> >
> > Then, I test it again with IDLE mode, the uP wakes up almost
> >immediately after a Keypad interrupt.
> >
> > Then I configure it to run using IRC, with Total Power Down
mode.
> >The uP wakes up almost immediately when there is keypad interrupt.
It
> >also wakes up when I used the Watchdog oscillator.
> >
> > Datasheet indicate oscillator stability after power down is 1024
> >clocks. This is about 30ms only.
> >
> >1) Why is it that external 32kHz clock took 2 seconds?
> >
> >2) Has anyone do a Total Power Down mode with LPC901/2/3 before?
> >
> >Ow Tong Peow
> >
> > No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05



Unless you had the datasheet on the crystal it's hard to say. But some
things you need to "watch" for (unintentional pun) is to avoid excessive
heat when soldering and make sure that there is no flux residue around
the oscillator connections. The heat can really degrade the crystal and
the flux is conductive enough especially in these sensitve low-power
circuits.

100ms is still sounding hopeful. Seeing that you turn off the
oscillator, does your application really need the crystal? Can you just
run with the IRC?

BTW, I haven't used the LPC900s "yet".

*Peter* ow_tong_peow wrote:

>Thanks Peter. I certainly doesn't know this before. Bad low current
>watch crystal!!
>
>If I replaced it with a normal 32kHz crystal, will the wakeup time
>improve? Better to know before rushing to the Electronics store to
>get it. I am trying to get a response time in 100ms or less.
>
>Thanks,
>Ow Tong Peow


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05



Hi Ow Tong Peow,

what about the following setup. You use the 32 kHz crystal as system
clock and leave it on all the time (not the IRC, consumes more power
because it is faster). You can even use the DIVM divider to reduce the
power consumption while running from 32 kHz. If you need the
processing power, you can switch the clock to the IRC, this is very
fast afaik 2 cycles of the 32 kHz clock. Now you have 7.373 MHz
processing power.
Are you using the 32 kHz in connection with the real time clock or is
the performance of 16 KIPS (16000 instrcutions per second) enough?

Would be interested to learn more about your application because we
use devices of the LPC900 family in low power applications too.

Cheers, Bob

--- In lpc900_users@lpc9..., Peter Jakacki <peterjak@t...> wrote:
> Unless you had the datasheet on the crystal it's hard to say. But some
> things you need to "watch" for (unintentional pun) is to avoid
excessive
> heat when soldering and make sure that there is no flux residue around
> the oscillator connections. The heat can really degrade the crystal and
> the flux is conductive enough especially in these sensitve low-power
> circuits.
>
> 100ms is still sounding hopeful. Seeing that you turn off the
> oscillator, does your application really need the crystal? Can you just
> run with the IRC?
>
> BTW, I haven't used the LPC900s "yet".
>
> *Peter* > ow_tong_peow wrote:
>
> >Thanks Peter. I certainly doesn't know this before. Bad low current
> >watch crystal!!
> >
> >If I replaced it with a normal 32kHz crystal, will the wakeup time
> >improve? Better to know before rushing to the Electronics store to
> >get it. I am trying to get a response time in 100ms or less.
> >
> >Thanks,
> >Ow Tong Peow
> >
> > --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05




Dear Peter,

My application is running off a battery CR1220. The constant
output current is 0.1mA, which is very low. Capacity is 35mA. My
team then decide on using the external 32kHz watch crystal, since it
is cheap and easy to get.

Currently, we are using the breadboard, so the crystal
performance may degrade. Well, I have tried using external crystal
of 3Mhz, and LPC901 wakes up very fast (<10ms). Looks like I have to
go and buy a 32kHz crystal to test again.

//---------------------

Dear Bob,
Yes, good idea! At the moment, IRC power is not needed, I will try
to use IDLE mode with largest DIVM = 0xFF. On KBI, DIVM = 0x00.

LOL! Sounds interesting. Haven't done this before. Will let you
know the result.

My application is really simple. Just a counter that starts and
stops on a keypad interrupt. And also store the counter into the
Flash, so that on next power up, the counter can be recalled and
carry on incrementing.
--- In lpc900_users@lpc9..., "lpc2100_fan" <lpc2100_fan@y...>
wrote:
>
> Hi Ow Tong Peow,
>
> what about the following setup. You use the 32 kHz crystal as system
> clock and leave it on all the time (not the IRC, consumes more power
> because it is faster). You can even use the DIVM divider to reduce
the
> power consumption while running from 32 kHz. If you need the
> processing power, you can switch the clock to the IRC, this is very
> fast afaik 2 cycles of the 32 kHz clock. Now you have 7.373 MHz
> processing power.
> Are you using the 32 kHz in connection with the real time clock or
is
> the performance of 16 KIPS (16000 instrcutions per second) enough?
>
> Would be interested to learn more about your application because we
> use devices of the LPC900 family in low power applications too.
>
> Cheers, Bob
>
> --- In lpc900_users@lpc9..., Peter Jakacki <peterjak@t...>
wrote:
> > Unless you had the datasheet on the crystal it's hard to say. But
some
> > things you need to "watch" for (unintentional pun) is to avoid
> excessive
> > heat when soldering and make sure that there is no flux residue
around
> > the oscillator connections. The heat can really degrade the
crystal and
> > the flux is conductive enough especially in these sensitve low-
power
> > circuits.
> >
> > 100ms is still sounding hopeful. Seeing that you turn off the
> > oscillator, does your application really need the crystal? Can
you just
> > run with the IRC?
> >
> > BTW, I haven't used the LPC900s "yet".
> >
> > *Peter*
> >
> >
> > ow_tong_peow wrote:
> >
> > >Thanks Peter. I certainly doesn't know this before. Bad low
current
> > >watch crystal!!
> > >
> > >If I replaced it with a normal 32kHz crystal, will the wakeup
time
> > >improve? Better to know before rushing to the Electronics store
to
> > >get it. I am trying to get a response time in 100ms or less.
> > >
> > >Thanks,
> > >Ow Tong Peow
> > >
> > >
> >
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05



I'm a little confused. Why does your application need a crystal? All you
need to do is to wake-up, update a counter, then go back to sleep. The
IRC uses only 256 clocks for start-up and then the system screams
through a short bit of code, then goes to sleep. Surely this constitutes
ultra-low-power operation. Waiting around for crystal oscillators to
stabilise surely consumes power, even if it does eventually run at 32KHz.

Also, why are you writing to Flash when you have a perfectly good
battery-backed RAM?

*Peter*

ow_tong_peow wrote:

>Dear Peter,
>
> My application is running off a battery CR1220. The constant
>output current is 0.1mA, which is very low. Capacity is 35mA. My
>team then decide on using the external 32kHz watch crystal, since it
>is cheap and easy to get.
>
> Currently, we are using the breadboard, so the crystal
>performance may degrade. Well, I have tried using external crystal
>of 3Mhz, and LPC901 wakes up very fast (<10ms). Looks like I have to
>go and buy a 32kHz crystal to test again.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05



Dear Peter,

Yes, I could use IRC for a very fast start up and do some quick
computation. But, the current consumption during active mode is more
than 1mA. I am also concern on the current consumption when writing
to the Flash during active mode.

I could accept it if the wake up time is < 100ms. 2sec wake up
time would not be acceptable.

I need to write to the Flash, so that when the battery is changed,
I can still read back my last counter value.

The battery has to last for a year, assuming 100 wakeup per day.

Ow Tong Peow.

--- In lpc900_users@lpc9..., Peter Jakacki <peterjak@t...>
wrote:
> I'm a little confused. Why does your application need a crystal?
All you
> need to do is to wake-up, update a counter, then go back to sleep.
The
> IRC uses only 256 clocks for start-up and then the system screams
> through a short bit of code, then goes to sleep. Surely this
constitutes
> ultra-low-power operation. Waiting around for crystal oscillators
to
> stabilise surely consumes power, even if it does eventually run at
32KHz.
>
> Also, why are you writing to Flash when you have a perfectly good
> battery-backed RAM?
>
> *Peter*
>
> ow_tong_peow wrote:
>
> >Dear Peter,
> >
> > My application is running off a battery CR1220. The constant
> >output current is 0.1mA, which is very low. Capacity is 35mA. My
> >team then decide on using the external 32kHz watch crystal, since
it
> >is cheap and easy to get.
> >
> > Currently, we are using the breadboard, so the crystal
> >performance may degrade. Well, I have tried using external
crystal
> >of 3Mhz, and LPC901 wakes up very fast (<10ms). Looks like I have
to
> >go and buy a 32kHz crystal to test again.
> >
> >
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05



Yes, have you measured the IRC startup time? It should be extremely
short, certainly way less than the crystal option. There is still the
DIVM there to reduce the chip power if not the IRC power itself.

I also believe that the watchdog oscillator can be used. It runs at
400KHz, have you considered this?

It would be so easy if your system knew the battery was or needed to be
replaced then it could do a single flash write, but not in the real
world. Any capacitor that you place across the battery to maintain the
RAM would introduce leakage itself but it might be worth exploring.

Utilizing a modified counter update routine which uses consecutive blank
locations in the sector would cut the flash access time in half (no
erase needed). Once the sector is full then you can update a normal
counter location then an erase operation can be performed and you start
again. It's a bit like counting by writing strokes for each item then
crossing through them when you get to five except in this case you count
256 before you "cross" them.

*Peter* ow_tong_peow wrote:

>Dear Peter,
>
> Yes, I could use IRC for a very fast start up and do some quick
>computation. But, the current consumption during active mode is more
>than 1mA. I am also concern on the current consumption when writing
>to the Flash during active mode.
>
> I could accept it if the wake up time is < 100ms. 2sec wake up
>time would not be acceptable.
>
> I need to write to the Flash, so that when the battery is changed,
>I can still read back my last counter value.
>
> The battery has to last for a year, assuming 100 wakeup per day.
>
>Ow Tong Peow.


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05



Dear Peter,

Yes, the IRC time is really short. I love it. My application
also has a RTC timer for counter.

Is this possible?

1) Start Running on IRC.

2) Start RTC using 32kHz watch crystal. Interrupt at 1s

3) IRC go to Total Power down mode.

4) On RTC or Keypad interrupt. Wakeup, use IRC for processing.

5) Go to (3).

Regards,
Ow Tong Peow --- In lpc900_users@lpc9..., Peter Jakacki <peterjak@t...>
wrote:
> Yes, have you measured the IRC startup time? It should be extremely
> short, certainly way less than the crystal option. There is still
the
> DIVM there to reduce the chip power if not the IRC power itself.
>
> I also believe that the watchdog oscillator can be used. It runs at
> 400KHz, have you considered this?
>
> It would be so easy if your system knew the battery was or needed
to be
> replaced then it could do a single flash write, but not in the real
> world. Any capacitor that you place across the battery to maintain
the
> RAM would introduce leakage itself but it might be worth exploring.
>
> Utilizing a modified counter update routine which uses consecutive
blank
> locations in the sector would cut the flash access time in half (no
> erase needed). Once the sector is full then you can update a normal
> counter location then an erase operation can be performed and you
start
> again. It's a bit like counting by writing strokes for each item
then
> crossing through them when you get to five except in this case you
count
> 256 before you "cross" them.
>
> *Peter* > ow_tong_peow wrote:
>
> >Dear Peter,
> >
> > Yes, I could use IRC for a very fast start up and do some quick
> >computation. But, the current consumption during active mode is
more
> >than 1mA. I am also concern on the current consumption when
writing
> >to the Flash during active mode.
> >
> > I could accept it if the wake up time is < 100ms. 2sec wake up
> >time would not be acceptable.
> >
> > I need to write to the Flash, so that when the battery is
changed,
> >I can still read back my last counter value.
> >
> > The battery has to last for a year, assuming 100 wakeup per day.
> >
> >Ow Tong Peow.
> >
> > --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 1/31/05




The 2024 Embedded Online Conference