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的更多相关文章

  1. 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 ...

  2. 2017.11.27 变量进阶与LED矩阵

    局部变量:函数内部声明的变量,只在函数内部有效. 全部变量:在函数外部声明的变量,全局都有效,直到程序执行完毕. 全局变量负作用: 1.降低函数的独立性 2.降低函数的通用性,不利于函数的重复调用. ...

  3. 2017.11.27 用Servlet在JSP中加入验证码

    登陆界面 <%@ page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML ...

  4. [LOJ 6249]「CodePlus 2017 11 月赛」汀博尔

    Description 有 n 棵树,初始时每棵树的高度为 H_i,第 i 棵树每月都会长高 A_i.现在有个木料长度总量为 S 的订单,客户要求每块木料的长度不能小于 L,而且木料必须是整棵树(即不 ...

  5. PatentTips - Fast awake from low power mode

    BACKGROUND Electronic devices, such as electronic book readers ("eBook reader devices"), c ...

  6. 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 ...

  7. bzoj 3969: [WF2013]Low Power 二分

    3969: [WF2013]Low Power Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://www.lydsy.com/JudgeOnli ...

  8. [CortexM0--stm32f0308]Low Power Mode

    问题描写叙述 stm32f0308正常是运行在Run mode下.这样的mode是在reset之后的默认模式.Low Power Mode.即低功耗模式.用于在IC空暇时能够考虑选择进入.使系统耗能减 ...

  9. 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- ...

随机推荐

  1. Vuex核心知识(转)

    转:http://www.cnblogs.com/ghost-xyx/p/6380689.html Vuex 是一个专门为 Vue.js 应该程序开发的状态管理模式,它类似于 Redux 应用于 Re ...

  2. JAVA学习笔记----【转】 java.toString() ,(String),String.valueOf的区别

    在java项目的实际开发和应用中,常常需要用到将对象转为String这一基本功能.本文将对常用的转换方法进行一个总结. 常用的方法有Object#toString(),(String)要转换的对象,S ...

  3. php获取MAC地址

    /** *获取mac地址 **/ class GetMacAddr{ var $return_array = array(); // 返回带有MAC地址的字串数组 var $mac_addr; fun ...

  4. Linux Shell基础 环境变量

    环境变量 环境变量和用户自定义变量最主要的区别在于,环境变量是全局变量,而用户自定义变量是局部变量.用户自定义变量只在当前的 Shell 中生效,而环境变量会在当前 Shell 和这个 Shell 的 ...

  5. 正则表达式----grep

    正则就是用一些具有特殊含义的符号组合到一起(称为正则表达式)来描述字符或者字符串的方法.或者说:正则就是用来描述一类事物的规则. grep [参数]  匹配条件  路径  参数 : -n  :显示行号 ...

  6. python配置文件操作

    步骤: 1.导入模块  import configparser 2.创建实例 cf = configparser.ConfigParser() 3.读取配置文件,若配置文件中有中文,则需设置编码格式  ...

  7. HTML5_CSS3实现iOS Path菜单

    在线演示 本地下载

  8. python:格式化输出 str.format()

    官网说明:https://docs.python.org/2/library/string.html#formatstrings python的格式输出有两种方法: 1.“ %s”.(variant) ...

  9. CoreData的基本操作

     Managed Object Model(被管理对象模型): –数据库的轮廓,或者结构.包含了各个实体的定义信息      Persistent Store Coordinator (持久性数据协调 ...

  10. 关于Hystrix

    RPC远程调用过程中如何防止服务雪崩效用 微服务中如何保护服务 Hystrix是一个微服务中关于服务保护框架,在分布式中能够实现对服务容错.出错之后的预备方案 背景 在今天,基于SOA的架构已经大行其 ...