Pin pull-up or pull-down

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Chip is xmega-e5, one input pin (async) is connected to button, for waking up slpeeping cpu, which is more energy efficient way

button connects pin to ground pulled up with resistor, or button to v+ and resistor keeps pin pulled down.

Ana

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Traditional way is to put the button to ground and use the internal pullup resistor. 

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And if you want to really, really, save energy, then think about using an external, high value resistor.

When the push button switch is open, (normal state), there is minimal current flowing through the pull up resistor.

Just a very small leakage current that I can't even come close to measuring on my bench.

 

But when the user presses the button, one has the resistor essentially connected from V+ to Ground, drawing current for the duration of the press.

You can limit this current by using a higher value resistor than the internal pull up resistor.

 

But, you really need to look at the overall application to decide if this amount of energy savings is even worth considering.

(Just how often is the button pressed, and for how long?)

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When button is pressed cpu wakes up, runs about 12 hours, and goes back to sleep, system may sleep several mohths before

next 'start', so system is mostly sleeping. Uses 3.6 V lithium battery.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How fast is your E5 running for 12 hours? How many mAH is your battery? I'm thinking it could wait for a button press for years, but 12 hours of activity might run it down. What's it doing for 12 hours? Perhaps we can figure out how to make it sleep most of that time too.

 

I have one that runs on a CR2032 battery. Wakes up for a few milliseconds and sends a message using a (fake) NRF24L01+. It also blinks an led to let you know it's working. Of course, the LED uses more power than everything else. It's been in occasional use for more than a year.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cpu is running 8 MHz, battery is 2400 mAh/3.6V (AA size). System uses nrf24l01+ (not fake), functionality:

send message, waits until message is sent (about 500 us), put nrf to powersave state and go to powersave state, RTC wakes it up after 8 ms, it sends message again.

During every 128. send seq led is on 3 ms,

If button is pressed > 1 sec or > 12 hours is reached set RTC off -> system is powersave mode and wakes up only by pressing button.

If user forget to shut down system it is done autotically after 12 hours.

I calculated battery is good for ~100...200 * 12 hours run cycle. Sleep mode consumption is ~2 uA.

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds good. Just using the internal pullup and a button to ground should let it wait for years.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Sleep mode consumption is ~2 uA

Have you measured this?  Or just calculated it based on claims in the datasheets?

 

I ask because:

nrf24l01+ (not fake),

First, how do you know?

 

Second, I've found that the claims made in the datasheet w.r.t. standby current are not true.  In some cases the actual sleep current was well above 1 mA.  That may be because the modules I have tested use 'fake' nRF24L01+ chips, or perhaps because the modules made with them were poorly designed.

 

I would measure the sleep current.  If it is in fact as low as you say, then you're fine.  If however the sleep current is as bad as I've seen, then your app will last only about 3 months in standby.  You could work around this by switching power to the nRF24L01+ with an AVR pin controlling a P-channel MOSFET.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So Joey, how many times has the OP replaced the battery since 2015 wink

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Curses!  I'm usually the one pointing out unwitting necromancy to others who have committed it...

 

Spam I suppose?  Or a recent cherry-pick/thread-split? 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:

Curses!  I'm usually the one pointing out unwitting necromancy to others who have committed it...

 

Spam I suppose?  Or a recent cherry-pick/thread-split? 

 

There was a carpet bomber this morning that cliff cleaned up, but a couple of threads stayed visible.

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user