[STM8] stm8l 低功耗

[复制链接]
820|3
 楼主| googcheng 发表于 2019-9-25 16:52 | 显示全部楼层 |阅读模式
本帖最后由 googcheng 于 2019-9-25 20:15 编辑

系统时钟是HSI, 2mhz  

  1. GPIO_Init(GPIOA, GPIO_Pin_2 | GPIO_Pin_3, GPIO_Mode_Out_PP_Low_Slow);
  2.     GPIO_Init(GPIOB, GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 |
  3.                      GPIO_Pin_5 | GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow);
  4.                      
  5.    
  6.     GPIO_Init(GPIOD, GPIO_Pin_4|GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow);
  7.                      
  8.     GPIO_Init(GPIOC, GPIO_Pin_4 |GPIO_Pin_7 , GPIO_Mode_Out_PP_Low_Slow);
  9.    
  10.     GPIO_Init(GPIOE, GPIO_Pin_6, GPIO_Mode_Out_PP_Low_Slow);
  11.     GPIO_Init(GPIOF, GPIO_Pin_0, GPIO_Mode_Out_PP_Low_Slow);


  12. while(1)
  13. {
  14.     halt();
  15. }


1, 设置这些io 电平 功耗没有降  是必须设置为LSI 吗
2, 如果系统时钟设置为LSI, 那i2c 就应该没有100khz时钟

18990194628 发表于 2019-9-25 17:54 | 显示全部楼层
建议进入休眠模式后看gpio对功耗的影响,全速运行下可能gpio对功耗影响太少看不出来
 楼主| googcheng 发表于 2019-9-25 20:10 | 显示全部楼层
18990194628 发表于 2019-9-25 17:54
建议进入休眠模式后看gpio对功耗的影响,全速运行下可能gpio对功耗影响太少看不出来 ...

active halt 下面也没有降低
18990194628 发表于 2019-9-26 09:01 | 显示全部楼层
googcheng 发表于 2019-9-25 20:10
active halt 下面也没有降低

这些gpio如果是悬空的,那么怎么设置都不会影响功耗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

32

主题

58

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部