RESET vs capacitor vs bounce in Atmel's note

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

Hi,

Indisputable to me is, that if I use a switch and a capacitor on pin RESET, it's very important to add a series resistor to the switch.

I also know that the relay contacts at high currents can stick together.

Of course I also know what is switch bounce.

But i read Atmel's AVR042 note, and there is information :

Quote:
Whenever the switch is pressed it will short the capacitor, the current through the switch can have high peak values. This will cause the switch to bounce and give steep spikes in 2-10ms periods until the capacitor is discharged.

Do I correct understand that discharging current from the capacitor generates a bounce?

Why? How?

Regards from Poland

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

Switches bounce, full stop. The USUAL 100nF cap on the reset will not burn out the switch contact. Some processors use higher value caps like 10uF which will pack a lot more evergy so a small resistor like you are showing is helpful.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thx for answer, but I didn't ask about what you wrote. I wrote at begining, that I know it.

You didn't answer for my question. Read carefully quoted text from datasheet and then my question.

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

The "bounce" is a mechanical phenomenon, not an electrical one, so no. If one really wants nitpick, the switch shorting the capacitor with the series inductance of the conductors forms Tesla's famous "disruptive discharge" circuit, which can oscillate at radio frequencies during the brief period the contacts arc. Does any of this matter for a reset button? No.

Tom Pappano
Tulsa, Oklahoma

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

The switch contacts will bounce REGARDLESS of whether there is current flowing or not as noted above.

How can they produce "steep spikes in 2-10ms periods" is beyond me as a 100nF cap shorted by a, almost 0 Ohms, contact would only take a nano second, or less, to discharge.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
How can they produce "steep spikes in 2-10ms periods" is beyond me as a 100nF cap shorted by a, almost 0 Ohms, contact would only take a nano second, or less, to discharge.
You forgot about the series resistor RC time constant, the tiny inductance (it does not seem like much) and then C recharging from the AVR reset pin internal pull up between mechanical switch bounces.

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

100nF and the internal pullup would be a few ms, maybe 5ms time constant, if the internal pull up is 50K. If you have a 10K (or 4K7 like I use) then it would be 0.5-1ms but that's up to 63% of the supply.

I would think that bounce would occur before that happens keeping the cap pretty low.

So, if that happens, the processor MAY reset more than once when the reset PB is used. Will this make any differrence to the functionality of a system?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

tpappano wrote:
The "bounce" is a mechanical phenomenon, not an electrical one ...

js wrote:
The switch contacts will bounce REGARDLESS of whether there is current flowing ...

A wrote at first post that i know it very well.

I'm asking only, why Atmels wrote:

Quote:
Whenever the switch is pressed it will short the capacitor, the current through the switch can have high peak values. This will cause the switch to bounce and give steep spikes in 2-10ms periods until the capacitor is discharged.

My english is not perfect, but i understand this sentence above like Atmel said:

Current from capacitor through switch without resistor, cause the switch to bounce (makes switch bounce).

Maybe i'm wrong., but in my opinion it's imposible.

So, the question is still:

Dondu_ wrote:
Do I correct understand that discharging current from the capacitor generates a bounce?
Why? How?

or Atmel wrote wrong information
or my english is worst than i'm thinking :)

Last Edited: Mon. Oct 17, 2011 - 12:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If bounce is, in part, caused by high current sparking between the switch contacts then I think I can see how that may cause spurious apparent closures before the contacts are fully closed - but what do I know, I'm a software engineer ;-)

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

Bouncing is a mechanical phenomena. Period. Has no relationship to the current flow (to some extents, of cause).
Capacitor only shall sustain generation of spikes until discharged, that's true. Resistor in series just helps fight this.

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

Dondu_ wrote:
I'm asking only, why Atmels wrote: ...
Did you ask ATMEL support?

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

Quote:
So, the question is still:
Dondu_ wrote:
Do I correct understand that discharging current from the capacitor generates a bounce?
Why? How?

Answer is still *no*

Tom Pappano
Tulsa, Oklahoma

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

Mike B wrote:
Did you ask ATMEL support?

No, I will try.

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

Quote:

No, I will try.

What problem are you trying to solve?

1) Buttons bounce. You ask "why". Does it matter "why"? what problem are you trying to solve?
2) Since the external reset could cause a bounce, the AVR would rapidly go in an out of reset a few times. That problem can easily be solved with a small delay at startup to let external hardware--including the /RESET pin--settle. I usually use 100ms or more in most of my apps. Trying to do (for example) an LCD display a few microseconds after a power on is a sure recipe for confusing program operation.

3) Series resistor--yes. Not just from the discussion above, but to >>any<< real-world signal to avoid problems from static electricity discharge and other unforseen external events.

4) If the question is still "how" and "why" use your 'scope to watch the bounces at the switch and the AVR pin.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

@ theusch
Thx for answer but please read my posts carefully, and don't lose your time.
I'm not asking about you wrote :)

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

Quote:

Thx for answer but please read my posts carefully, and don't lose your time.

I did, and still want to know what problem you are trying to solve. So far it seems like you have problems with the weather turning colder in the winter.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

theusch wrote:
I did, and still want to know what problem you are trying to solve. So far it seems like you have problems with the weather turning colder in the winter.

I have no problem with any circuit.
I want to know what i asked. Just read my posts again.

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

theusch wrote:
Quote:

1) Buttons bounce. You ask "why". Does it matter "why"? what problem are you trying to solve?

I don't think he's asking why buttons bounce. I think he's asking if one of the things that make them bounce is high current sparking between the switch contacts.

I would say no, that sparking is a different thing.

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

Just my two cents here, but nobody has yet given an explanation why there is the formula of V=L*dI/dt there.

Normally people put capacitance on the reset pin, and ceramic capacitors have very low ESR (series resistance). When you short circuit the charged capacitor with the pushbutton, there is a huge change in current in very short time period. Say 5V charged to the capacitor and 0.5 ohms total resistance in circuit means 10 Amperes current surge in very short time, say 1 nanoseconds. If the stray inductance of the circuit is 1 nanohenries, then the induced voltage is 10V. It does not help if the pushbutton bounces, it may just make things worse.

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

OK, I'll try . . .

Maybe the person who wrote that note you are referring to didn't really know why they were getting switch bounce.

Or, maybe they know something that is not common knowledge.

Either ask ATMEL or set up an experiment AND then report back.

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

Quote:

Normally people put capacitance on the reset pin, and ceramic capacitors have very low ESR (series resistance). When you short circuit the charged capacitor with the pushbutton, there is a huge change in current in very short time period. Say 5V charged to the capacitor and 0.5 ohms total resistance in circuit means 10 Amperes current surge in very short time, say 1 nanoseconds. If the stray inductance of the circuit is 1 nanohenries, then the induced voltage is 10V. It does not help if the pushbutton bounces, it may just make things worse.

10V? 10A? Scary on an AVR pin, eh?

However...almost all AVR models have a HVPP or HVSP mode, which is done with 12V on the /RESET pin. So 10V is not a dire problem.

While I can't find any numbers in a couple of datasheets, the /RESET pin is still a high-impedance input, isn't it, when used as a reset pin? And it has an internal weak pullup. (Things might be different in the middle of a debugWire session but that isn't the case here.) So you sparkies have to tell me how much of this 10A is getting into the AVR.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

theusch wrote:
So you sparkies have to tell me how much of this 10A is getting into the AVR.

The capacitor discharge current is not going into the AVR, but the rapidly changing current over stray inductance on PCB can generate over/undershoots that are outside of safe limits.

Basically the same thing when you have improper source termination on strong bus drivers, after 10 cm you get around 1 volts of over/undershoot, and chips are not going to like that.

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

Quote:

Basically the same thing when you have improper source termination on strong bus drivers, after 10 cm you get around 1 volts of over/undershoot, and chips are not going to like that.

But on the /RESET, there is indeed some termination--the weak pullup--and 1V ain't gonna hurt anything.

My summary: One part tempest in a teapot; one part series R is good for static discharge if nothing else.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Atmel's support:

Quote:
Message added by Jacek Dondu, 20.10.2011 13:55

Hi,
I have problem to understand AVR042 note: http://www.atmel.com/dyn/resourc...
There is information about capacitor atRESET pin (on page 4):

"3.1 External RESET switch
...
Whenever the switch is pressed it will short the capacitor, the current
through the switch can have high peak values. This will cause the switch to bounce and give steep spikes in 2-10ms periods until the capacitor is discharged.
..."

Ofcourse i know what is switch bounce (mechanical phenomenon), but in sentence above there is information, that current from capacitor through the switch can make (additional) bounce of switch.

How it's possible?

In my opinion current from capacitor through the switch without resistor, cannot make (additional) bounce. Bounce are only mechanical phenomenon. But I could be wrong.

It's very important for me because i'm publisher of blog about AVR microcontrollers for Polish engineers.

Regards from Poland
Jacek

Quote:
Message added by Manoj Kumar, 21.10.2011 14:22

Dear Jacek,

Yes you are correct. The current through the switch from the capacitor does
not make the switch to bounce.

Switch contacts are usually made of springy metals that are forced into
contact by a mechanical force usually by a finger press. When the contacts
strike together, the switch's mechanical properties (like momentum,
elasticity) act together to cause the bounce.

This bounce result is a rapidly pulsed or steep spikes of electric current
instead of a clean transition from zero to full value.

Without using a series resistor, the PCB tracks and the switch metal will
introduce a small inductance and this inductance can generate high voltages
according to Vi = L* di/dt. These voltages are most likely outside the
specification of the RESET pin.

Adding a series resistor between the switch and the capacitor the peak
currents generated will be significantly, these currents won't be large
enough to generate high voltages at the RESET pin as given in the
application note.

Best Regards,
Manoj Kumar
Atmel Technical Support Team

Quote:
Message added by Jacek Dondu, 21.10.2011 14:40
Thank you for fast answer.

So, all you wrote is know to me. I suggest to change the text to be more understandable.

Regards from Poland
Jack

Quote:
Message added by Srinivasan Mariappan, 21.10.2011 15:28

Hello,

Thank you for the feedback.

We will have this intimated to our internal resources and hope will be made easy to understand in future as soon as possible.

Best Regards,
Srinivasan Mariappan
Atmel Technical Support Team