Skip to main content
Omkar Teli
Associate II
Jan 19, 2018 3:09 PM UTC
Question

ON/OFF Microcontroller

Posted on January 19, 2018 at 16:09

We are using STM8L051F3 and it has 2 inputs which is 2 key keypad which we are using for our application. Now i want to use that keypad for ON/OFF of microcontroller also.How i can do that? I want to ON controller power supply when i press keypad key and then i will use those key for my application also and then if i key for long time or press both keys it will OFF, i.e. power supply cut off. This is like our old keypad mobile phones which has 1 key for Mobile phone ON and that same key we can use for receiving call also. How can i do that for my STM8L051F3?

    This topic has been closed for replies.

    7 replies

    Associate III
    Jan 19, 2018 3:35 PM UTC
    Posted on January 19, 2018 at 16:35

    Maybe these materials will be useful to you: 

    https://sourceforge.net/p/s3-code/code/ci/master/tree/superbutton/

    Omkar Teli
    Associate II
    Jan 20, 2018 4:55 AM UTC
    Posted on January 20, 2018 at 05:55

    Hi thanks for response, Yea i can do that longer button press detection using timer. Main thing is hardware i think, That i want to give power supply to controller using 1 button not switch, means if i pressed once power supply goes to controller then our application will work and if i pressed that button little longer it will off. Problem cant be solved by just code i think, it needs hardware. So i built latch circuit which gets ON when i press a key and our controller gets power supply but then i cant use that key for my application as it is always high, as it is base pin of BC547.

    Associate III
    Jan 20, 2018 7:27 AM UTC
    Posted on January 20, 2018 at 07:27

    It is how you want. Modern micro-controllers do not need to remove power.

    The current consumption in sleep mode is very small. A wake up the

    controller can be executed by the same button, connecting it to the wake up

    input signal.

    Omkar Teli
    Associate II
    Jan 20, 2018 8:25 AM UTC
    Posted on January 20, 2018 at 08:25

    So there is no way to completely off microcontroller?