Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

one-time interrupt on start-up.

Status
Not open for further replies.

alphadog

Banned
I have an external button.
The button's output is normally HIGH, and when i press it, it falls down to LOW (until i release it and it rises back up to high).
A tri-state input pin of MCU is connected to the button's output.

The problem is this:
When the input pin is set to 'Falling Edge of Input gives interrupt', then every time that the MCU is powered up, i receive a one-time interrupt.

It doesnt happen when the input pin is set to 'Rising Edge of Input give interrupt'.

Do you have any idea why does it happen?

Thanks alot!
 
Put a cap across the switch, like .1µf. You have a resistor tying the pin high, switch to ground, right? That resistor and this cap will make an RC time delay that will hold the reset voltage a little lower than Vcc on power-up.
 
Thanks.

However, if the voltage fell down for a short moment and went up (since the button's output is normally HIGH), how come it didnt trigger an interrupt when it went up (i'm refering the 'Rising Edge' case).

Thank you.
 
Last edited:
Reliable power-up interrupt circuitry requires more than simply tying it to Vcc or something.
 
What do you mean please?
I think i missed you on that.

In your first response you said that the voltage on the input MCU pin was unstable, and therefore you suggested to connect a cap.
But, if the voltage was indeed unstable, shouldn't it trigger a 'rising edge' interrupt, just like it triggered a 'falling edge' interrupt?
 
Yes, that's the way it's usually handled. Interrupts should be off coming out of reset, the default is like that (unless you mean "wake up" instead of "reset", very different) and then you clear them (just in case) then enable them, and if eveything isn't cool you give it a ten millisecond (or whatever) delay, THEN clear and enable.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top