ST意法半导体
直播中

孙燕冉

7年用户 328经验值
私信 关注
[问答]

如何用STM8L051F3来开启/关闭微控制器?

我们使用的是STM8L051F3,它有2个输入,这是我们用于我们应用的2键键盘。现在我想用那个键盘来开启/关闭微控制器。我怎么能这样做?我想在按下键盘按键时打开控制器电源,然后我也会将这些按键用于我的应用程序然后如果我长按键或按两个按键它将关闭,即电源切断。这就像我们的旧键盘手机一样,手机上有1个按键,也可以用来接听电话。我怎么能为我的STM8L051F3做到这一点?

以上来自于谷歌翻译


以下为原文





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?

回帖(7)

杨明

2019-7-1 07:23:11
也许这些材料对您有用:
https://sourceforge.net/p/s3-code/code/ci/master/tree/superbutton/

以上来自于谷歌翻译


以下为原文




Maybe these materials will be useful to you:  
https://sourceforge.net/p/s3-code/code/ci/master/tree/superbutton/
举报

孙燕冉

2019-7-1 07:37:52
嗨,谢谢你的回复,是的,我可以使用计时器进行更长的按键检测。主要的是硬件,我认为,我想给控制器使用1个按钮而不是开关给电源,意味着如果我按下一次电源进入控制器然后我们的应用程序将工作,如果我按下该按钮一点点它将关闭。问题不能通过我想的代码来解决,它需要硬件。所以我建立了闩锁电路,当我按下一个键并且我们的控制器获得电源时它接通但是我不能将该键用于我的应用,因为它总是很高,因为它是BC547的基准引脚。

以上来自于谷歌翻译


以下为原文




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.
举报

杨明

2019-7-1 07:50:02
这是你想要的。现代微控制器不需要移除电源。
睡眠模式下的电流消耗非常小。一觉醒来
控制器可以通过相同的按钮执行,将其连接到唤醒
输入信号。

以上来自于谷歌翻译


以下为原文




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.
举报

孙燕冉

2019-7-1 08:08:20
所以没有办法完全关闭微控制器?

以上来自于谷歌翻译


以下为原文




So there is no way to completely off microcontroller?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分