Author Topic: Push button Delay Circuit  (Read 2105 times)

0 Members and 1 Guest are viewing this topic.

Offline avc4evaTopic starter

  • Contributor
  • Posts: 18
Push button Delay Circuit
« on: March 16, 2015, 12:24:55 pm »
Hi all,

I have a question regarding a circuit i need to design:

I want to able to use a simple on/off momentary switch which when held for say 3-5 seconds interfaces with GPIO of MCU and turns on/off MCU (similar to the functionality of a smartphone when turning on/off).

I was thinking i would need some kind of LC circuit, the simpler the better, but should have consistent timing.

Or if anyone has any other suggestion to implement something similar to the of found in smartphones that would be great.

Andrea.
 

exapod

  • Guest
Re: Push button Delay Circuit
« Reply #1 on: March 16, 2015, 12:32:15 pm »
If the sleep current of the MCU is not too high you can use a GPIO with an interrupt that wakes up the MCU directly.
 

Offline avc4evaTopic starter

  • Contributor
  • Posts: 18
Re: Push button Delay Circuit
« Reply #2 on: March 16, 2015, 12:34:46 pm »
If the sleep current of the MCU is not too high you can use a GPIO with an interrupt that wakes up the MCU directly.

Yes this is the idea, however i want that typical 3-5s hold delay from smartphones to place into off/sleep.
 

exapod

  • Guest
Re: Push button Delay Circuit
« Reply #3 on: March 16, 2015, 12:41:54 pm »
You can do that in software with timers or rtc if you have one.
 

Offline avc4evaTopic starter

  • Contributor
  • Posts: 18
Re: Push button Delay Circuit
« Reply #4 on: March 16, 2015, 12:47:11 pm »
You can do that in software with timers or rtc if you have one.

True, however if the device is off/sleep that is difficult.
 

exapod

  • Guest
Re: Push button Delay Circuit
« Reply #5 on: March 16, 2015, 01:45:59 pm »
The first interrupt from the button wakes up the mcu, you set the rtc/timers for a 5s interrupt and go to sleep.
At this time if the user releases the button another interrupt is fired, the mcu wakes up you cancel the 5s interrupt and go to sleep.
If the user doesn't release the button the 5s interrupt wakes up the mcu and you are "on".
 

Offline avc4evaTopic starter

  • Contributor
  • Posts: 18
Re: Push button Delay Circuit
« Reply #6 on: March 16, 2015, 01:47:19 pm »
The first interrupt from the button wakes up the mcu, you set the rtc/timers for a 5s interrupt and go to sleep.
At this time if the user releases the button another interrupt is fired, the mcu wakes up you cancel the 5s interrupt and go to sleep.
If the user doesn't release the button the 5s interrupt wakes up the mcu and you are "on".

Ah great idea, thanks for that help!

Andrea
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf