2017.11.27 stm8 low power-consumption debugging
1 STM8L+LCD
The STM8L-DISCOVERY helps you to discover the STM8L ultralow power features and to
develop and share your applications. It is based on an STM8L152C6T6 and includes an
ST-Link embedded debug tool interface, LCD (24 segments, 4 commons), LEDs and push
buttons.

Figure 1. Hardware block diagram
2 Sleep mode


3 I/O current injection susceptibility


4 Low-power coding
The key is turn off I/O
void sleep_enter(void)
{
//off LCD
disableInterrupts();
prog_enter_sleep();
disp_enter_sleep();
LCD_Com_Page(0);
LCD_Cmd(DISABLE);
//disable 16Hz
RTC_WakeUpCmd(DISABLE);
GPIO_Init(POWER_12V_PORT,POWER_12V_PIN,GPIO_Mode_In_PU_IT);
//disable ADC Clock
CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, DISABLE);
enableInterrupts();
}
void sleep_exit(void)
{
disableInterrupts();
key_init();
temper_init();
//disable 16Hz
RTC_WakeUpCmd(ENABLE);
//disable ADC Clock
CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE);
//off LCD
LCD_Cmd(ENABLE);
GPIO_Init(POWER_12V_PORT,POWER_12V_PIN,GPIO_Mode_In_PU_No_IT);
enableInterrupts();
ADC_SoftwareStartConv(ADC1);
key_flag.f.disable=1; //clear the default key input
sys_time_load();
}
void sleep_func(void)
{
if((GPIO_ReadInputData(POWER_12V_PORT)&POWER_12V_PIN)==0){
sleep_enter();
_sleep_loop:
if((GPIO_ReadInputData(POWER_12V_PORT)&POWER_12V_PIN)!=0){
goto _sleep_exit;
}
halt();
if((GPIO_ReadInputData(POWER_12V_PORT)&POWER_12V_PIN)==0){
goto _sleep_loop;
}
_sleep_exit:
sleep_exit();
}
}
2017.11.27 stm8 low power-consumption debugging的更多相关文章
- Low Power Consumption Design --- MCU Attention
20161008 note : I have a PCB board called 'A' where a piece of STM8L052C6 and a piece of CC1101 are ...
- 2017.11.27 变量进阶与LED矩阵
局部变量:函数内部声明的变量,只在函数内部有效. 全部变量:在函数外部声明的变量,全局都有效,直到程序执行完毕. 全局变量负作用: 1.降低函数的独立性 2.降低函数的通用性,不利于函数的重复调用. ...
- 2017.11.27 用Servlet在JSP中加入验证码
登陆界面 <%@ page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML ...
- [LOJ 6249]「CodePlus 2017 11 月赛」汀博尔
Description 有 n 棵树,初始时每棵树的高度为 H_i,第 i 棵树每月都会长高 A_i.现在有个木料长度总量为 S 的订单,客户要求每块木料的长度不能小于 L,而且木料必须是整棵树(即不 ...
- PatentTips - Fast awake from low power mode
BACKGROUND Electronic devices, such as electronic book readers ("eBook reader devices"), c ...
- Network management system scheduling for low power and lossy networks
In one embodiment, a network management system (NMS) determines an intent to initialize a request-re ...
- bzoj 3969: [WF2013]Low Power 二分
3969: [WF2013]Low Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.lydsy.com/JudgeOnli ...
- [CortexM0--stm32f0308]Low Power Mode
问题描写叙述 stm32f0308正常是运行在Run mode下.这样的mode是在reset之后的默认模式.Low Power Mode.即低功耗模式.用于在IC空暇时能够考虑选择进入.使系统耗能减 ...
- tensorfolw配置过程中遇到的一些问题及其解决过程的记录(配置SqueezeDet: Unified, Small, Low Power Fully Convolutional Neural Networks for Real-Time Object Detection for Autonomous Driving)
今天看到一篇关于检测的论文<SqueezeDet: Unified, Small, Low Power Fully Convolutional Neural Networks for Real- ...
随机推荐
- 剑指offer 面试63题
面试63题 题目:股票的最大利润 题:假设把某股票的价格按照时间先后顺序存储在数组中,请问买卖该股票一次可获得的最大利润是多少?例如,一只股票在某些时间节点的价格为{9,11,8,5,7,12,16, ...
- Shell字符串操作
@1:子串削除 ${string#substring} 从$string 的开头位置截掉最短匹配的$substring. ${string##substring} 从$string 的开头位置截掉最长 ...
- 构建Ruby开发环境(Windows+Eclipse+Aptana Plugin)
1.安装Ruby ①.从http://rubyinstaller.org/downloads/下载安装包:rubyinstaller-2.2.5-x64.exe,直接安装.(so easy) 2.安装 ...
- Django_Form表单补充
Form表单 问题1: 注册页面输入为空,报错:keyError:找不到password def clean(self): print("---",self.cleaned_da ...
- Mapinfo修改道路方向
在mapinfp工具管理添加插件Reverse Line Direction,就可以修改道路方向 插件
- IMX6Q RTC驱动分析
对于在工作中学习驱动的,讲究的是先使用,再理解.好吧,我们来看看板子里是如何注册的? 在板文件里,它的注册函数是这样的: imx6q_add_imx_snvs_rtc() 好吧,让我们追踪下去: 1 ...
- @MarkFan 口语练习录音 20140406 [美女与野兽的口语练习录音]
大家好,您现在收听的是美女与野兽的口语练习录音 敢于追求,不惧任何挑战,才是勇敢的人生.试想一下,世界上每天有多少人为了梦想,为了生活,甚至是为了别人在不停地奔跑.假若你此刻心中装有梦想,却碍于现实不 ...
- Xib与Storyboard相关知识点
相同点 都用来描述软件界面 都用Interface Builder工具来编辑 本质都是转换成代码去创建控件 不同点 Xib是轻量级的,用来描述局部的UI界面 Storyboard是重量级的,用来描述整 ...
- 获取CPU利用率
#define MB (1024 * 1024) MEMORYSTATUSEX statex; statex.dwLength = sizeof (statex); GlobalMemoryStatu ...
- docker calico安装
第一步,安装etcd: 请参考以前的文章: http://www.cnblogs.com/vincenshen/articles/8637949.html 第二步,下载calico: sudo ...