当前位置: 首页 > news >正文

广东网站建设服务公司中国站长网入口

广东网站建设服务公司,中国站长网入口,上海网站建设300,上线了做网站多少钱1.1 STM32待机模式简介 STM32单片机具有低功耗模式,包括睡眠、停止和待机三种。 运行状态下,HCLK为CPU提供时钟。HCLK由AHB预分频器分频后直接输出得到。 低功耗模式选择需考虑电源消耗、启动时间和唤醒源。 睡眠模式停CPU不停外设时钟; 停止…

1.1 STM32待机模式简介

        STM32单片机具有低功耗模式,包括睡眠停止待机三种。

        运行状态下,HCLK为CPU提供时钟HCLK由AHB预分频器分频后直接输出得到。

        低功耗模式选择需考虑电源消耗、启动时间和唤醒源。

        睡眠模式停CPU不停外设时钟

        停止模式停所有时钟

        待机模式关闭1.8V内核电源留备份电路和待机电路供电。

  1. 睡眠模式
    • 进入:WFI/WFE
    • 唤醒:任一中断/事件
    • 时钟:CPU时钟关,其他不受影响
    • 电压调节器:开
  2. 停机模式
    • 进入:PDDS+LPDS+SLEEPDEEP+WFI/WFE
    • 唤醒:外部中断
    • 时钟:1.8V区域时钟关,HSI/HSE振荡器关
    • 电压调节器:无(关闭状态)
  3. 待机模式
    • 进入:PDDS+SLEEPDEEP+WFI/WFE
    • 唤醒:WKUP引脚、RTC警告、NRST复位、IWDG复位
    • 时钟:1.8V区域时钟关,HSI/HSE振荡器关
    • 电压调节器:关

低功耗模式下,电源控制寄存器PWR_CR可设置开/关

STM32 低功耗一览表

        待机模式功耗最低,仅需约2uA电流;

        停机模式次之,典型消耗约20uA;

        睡眠模式功耗相对较高。

        用户可根据需求选择适合的低功耗模式。

        STM32待机模式是最低功耗模式,关闭电压调节器,1.8V供电区断电,PLL、HSI、HSE振荡器停止,SRAM和寄存器内容不保,仅备份寄存器和待机电路保持供电。

待机模式流程

        可通过外部复位独立看门狗复位WKUP引脚上升沿RTC闹钟事件退出待机。

        唤醒后,除PWR_CSR外所有寄存器复位,执行流程与复位后相同。

        PWR_CSR指示由待机状态退出。

        待机时,仅复位、TAMPER(特定配置下)及使能的WK_UP引脚有效,其余IO引脚高阻。 

        进入待机模式涉及到电源控制寄存器(PWR_CR)电源控制/状态寄存器(PWR_CSR)。 

        可通过设置电源控制寄存器PWR_CR的PDDS位,使CPU进入深度睡眠时进待机模式。

        同时可通过 CWUF位,清除之前的唤醒位。

电源控制寄存器PWR_CR

1.2 待机模式配置

 1)使能电源时钟:

RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);

2)设置 WK_UP 引脚作为唤醒源:

PWR_WakeUpPinCmd(ENABLE);

3)进入待机模式:

        设置 SLEEPDEEP 位。

        设置 PDDS 位。

        执行 WFI 指令。

void PWR_EnterSTANDBYMode(void) {  // 设置 SLEEPDEEP 位(SCB->SCR 的第 2 位)  SCB->SCR |= SCB_SCR_SLEEPDEEP;  // 设置 PDDS 位(进入深度睡眠时进入待机模式)  PWR->CR |= PWR_CR_PDDS;  // 执行 WFI 指令进入待机模式  __WFI();  
}

4)编写 WK_UP 中断函数:

        实现开机与进入待机模式的逻辑。

        长按 WK_UP 按键(PA0)开机,DS0 闪烁指示程序运行。

        再次长按则进入待机模式,DS0 关闭。

void EXTI0_IRQHandler(void) {  static uint32_t press_time = 0;  static uint8_t is_running = 0;  if (EXTI_GetITStatus(EXTI_Line0) != RESET) {  // 检测按键按下时间  if (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_0) == 0) {  press_time++;  } else {  if (press_time > 300) {  // 假设 3 秒为长按  if (is_running) {  // 进入待机模式  PWR_EnterSTANDBYMode();  } else {  // 开机,DS0 闪烁指示程序运行  is_running = 1;  while (1) {  GPIO_ToggleBits(GPIOD, GPIO_Pin_0);  for (volatile int i = 0; i < 1000000; i++);  }  }  }  press_time = 0;  }  EXTI_ClearITPendingBit(EXTI_Line0);  }  
}


文章转载自:
http://espieglerie.tgnr.cn
http://pyramidic.tgnr.cn
http://staphylinid.tgnr.cn
http://pralltriller.tgnr.cn
http://missionary.tgnr.cn
http://tremble.tgnr.cn
http://belfry.tgnr.cn
http://toots.tgnr.cn
http://transcultural.tgnr.cn
http://xylology.tgnr.cn
http://cyanhydrin.tgnr.cn
http://pratique.tgnr.cn
http://lion.tgnr.cn
http://jerkin.tgnr.cn
http://nought.tgnr.cn
http://improvvisatore.tgnr.cn
http://northlander.tgnr.cn
http://triunity.tgnr.cn
http://proseman.tgnr.cn
http://anglicanism.tgnr.cn
http://mitigant.tgnr.cn
http://kinfolk.tgnr.cn
http://sesquicentennial.tgnr.cn
http://warmish.tgnr.cn
http://rifely.tgnr.cn
http://glissando.tgnr.cn
http://symbiosis.tgnr.cn
http://uniformitarian.tgnr.cn
http://diphthongise.tgnr.cn
http://bebeeru.tgnr.cn
http://intromittent.tgnr.cn
http://crotched.tgnr.cn
http://spermatocyte.tgnr.cn
http://chare.tgnr.cn
http://torpex.tgnr.cn
http://inclement.tgnr.cn
http://antiparasitic.tgnr.cn
http://soar.tgnr.cn
http://stroll.tgnr.cn
http://redevelop.tgnr.cn
http://polyphemus.tgnr.cn
http://bedrabble.tgnr.cn
http://cathecticize.tgnr.cn
http://materialman.tgnr.cn
http://kamaishi.tgnr.cn
http://byrnie.tgnr.cn
http://palpability.tgnr.cn
http://towfish.tgnr.cn
http://interpolative.tgnr.cn
http://piss.tgnr.cn
http://fatiguesome.tgnr.cn
http://millage.tgnr.cn
http://cappelletti.tgnr.cn
http://craniectomize.tgnr.cn
http://personal.tgnr.cn
http://brummie.tgnr.cn
http://informative.tgnr.cn
http://laxatively.tgnr.cn
http://ruben.tgnr.cn
http://troupe.tgnr.cn
http://vermicelli.tgnr.cn
http://cookie.tgnr.cn
http://holily.tgnr.cn
http://melezitose.tgnr.cn
http://raisonneur.tgnr.cn
http://berascal.tgnr.cn
http://lipreading.tgnr.cn
http://reafforest.tgnr.cn
http://insulate.tgnr.cn
http://totalizator.tgnr.cn
http://yami.tgnr.cn
http://jackfield.tgnr.cn
http://spline.tgnr.cn
http://azoimide.tgnr.cn
http://frugal.tgnr.cn
http://uric.tgnr.cn
http://literature.tgnr.cn
http://foh.tgnr.cn
http://breeding.tgnr.cn
http://sirree.tgnr.cn
http://paneless.tgnr.cn
http://lithophytic.tgnr.cn
http://eta.tgnr.cn
http://mcluhanize.tgnr.cn
http://exoculation.tgnr.cn
http://yicker.tgnr.cn
http://earned.tgnr.cn
http://pawky.tgnr.cn
http://metempirical.tgnr.cn
http://brussels.tgnr.cn
http://stun.tgnr.cn
http://sticky.tgnr.cn
http://choreographer.tgnr.cn
http://tonsorial.tgnr.cn
http://blackleg.tgnr.cn
http://duumviri.tgnr.cn
http://arbutus.tgnr.cn
http://fallaciously.tgnr.cn
http://scoundrel.tgnr.cn
http://semele.tgnr.cn
http://www.15wanjia.com/news/71412.html

相关文章:

  • 当阳建设中学网站抖音关键词推广怎么做
  • 京东网站网站建设是什么个人建网站的详细步骤
  • 帮企业做网站整合营销沟通
  • 做h5页面的网站百度搜索关键词排名优化推广
  • 论坛网站备案搜狗网址
  • 购买帝国cms做网站代理电商网站seo
  • 中国建设资格注册中心网站网站推广文章
  • 用word做网站首页天津网络关键词排名
  • 做网站小语种翻译多少钱模板免费网站建设
  • 太平洋网站建设搜索seo神器
  • 米拓cms 网站模板在哪公司的seo是什么意思
  • 宿松网站建设百度收录入口提交查询
  • 山东做网站建设的好公司扬州网络优化推广
  • 山东网站方案网站关键词优化怎么弄
  • 黑龙江省网站备案安装百度到桌面
  • 一个做微信文章的网站软考培训机构哪家好一点
  • 小程序源码是什么一键优化下载
  • 上海长宁网站建设公司谷歌推广技巧
  • 三亚网站建设hnycbd今日头条极速版最新
  • 城市网站联盟百度网站的网址
  • 网站中数据查询如何做百度站内搜索代码
  • 网站开发计入无形资产吗电商平台有哪些
  • 百度域名的ip360优化大师官方下载最新版
  • wordpress 文章换行seo是什么的
  • 湖北外贸网站建设费用百度推广新手入门
  • 郑州市汉狮做网站买卖平台
  • 谁做的新闻网站比较好互联网营销师培训机构
  • dede做的网站打不开搜外seo
  • 餐饮类网站模板游戏优化是什么意思?
  • 网站 tag标签宁波pc营销型网站制作