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 面试29题
面试29题: 题目:顺时针打印矩阵(同LeetCode 螺旋矩阵打印) 题:输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵: 1 2 3 4 5 6 7 8 9 ...
- jQuery:自学笔记(1)——基础入门
jQuery:自学笔记(1)——基础入门 认识JQuery 1.jQuery概述 jQuery是一个快速.小巧 .功能丰富的JavaScript函数库.它可以实现“写的少,做的多”的目标. jQuer ...
- js判断有无属性
访问元素属性 getAttribute 不存在返回null,特性名可不区分大小写 dom对象访问公共属性,自定义属性不能访问,div.id 访问对象属性 1.使用in关键字 该方法可以判断对象的自有属 ...
- C# TreeView,递归循环数据加载到treeView1中
TblAreaBLL bll = new TblAreaBLL(); private void button1_Click(object sender, EventArgs e) { LoadData ...
- 用C#编写猜数、九九乘法表‘、迷宫
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- NAS、SAN、DAS 说明
NAS 说明 1.NAS(Network Attached Storage:网络附属存储) 2.NAS 是一种采用直接与网络介质相连的特殊设备实现数据存储的机制. 3.NAS本身能够支持多种协议(如N ...
- node做验证码
使用了ccap插件 1.安装: 通用方法:npm install ccap 2. cnst ccap= require('ccap')({ width: 128, height: 40, offset ...
- java入门了解03
ASSCII表 . 1.final关键字 (1)含义:最终的意思,修饰方法,类,变量 (2)特点: A:修饰类,不能被继承 B:修饰的方法,不能被重载 ...
- linux基础(10)-导航菜单
导航菜单实战 例:编写一个shell脚本,包含多个菜单,其中需要一个退出选项:可单选也可多选:根据序号选择后,显示所选菜单名称. #!/bin/bash ####################### ...
- IOS 发布被拒 PLA 1.2问题 整个过程介绍 02 个人账户升级公司账户
首先,根据上一篇文章得出结论: 1.个人账户,可以发布非营销的APP.例如:公司企业站.个人站 2.公司账户,可以发布营销的APP.例如:京东,天猫,带有盈利的APP 3.企业账户,是使用在公司内部的 ...