你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

NUCLEO-L053R8:低功耗STOP模式,外部中断唤醒(例程分享)

[复制链接]
mmuuss586 发布时间:2019-1-25 13:16
NUCLEO-L053R8:低功耗STOP模式,外部中断唤醒(例程分享): H  y& Z( a% u
基于ST官方NUCLEO-L053R8开发板
代码下载见附件
Stop mode without RTC:0.4uA VDD=3.0V
2 n5 q+ }, ^; |2 P
int main(void)
; c8 r4 [' L6 m# @  ~{
! ^7 O. N3 G! j( N3 f" m7 Z! }7 u  /* STM32L0xx HAL library initialization:$ z' g4 ]/ i5 J( q2 j( \0 \. L
       - Configure the Flash prefetch, Flash preread and Buffer caches7 |, }5 m0 f* F( ~4 Q+ |& B
       - Systick timer is configured by default as source of time base, but user   m& P5 Z1 _6 w& i$ y& s
             can eventually implement his proper time base source (a general purpose ( K! P8 w% h) f
             timer for example or other time source), keeping in mind that Time base
. B4 ~# z# E/ O0 E) d             duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and : }/ f/ ], ^- v( {
             handled in milliseconds basis.
, w! ]% S" |. U" s  J& n5 [( ~       - Low Level Initialization
! o" y6 n% |/ A2 A" R/ f     */9 Y5 I2 Z4 d( {  |
  HAL_Init();
; o: a, f5 o+ j& y; U. {; V; w3 H3 a! c' w- i
  /* Configure LED2 */" I# I, R4 T( P
  BSP_LED_Init(LED2);
' w2 I3 z- a9 C- y  m, M+ L' v1 z8 k7 A8 z' c/ n4 M
  /* Configure the system clock @ 32 Mhz */
9 v0 Q. `4 t& \! |0 I  SystemClock_Config();
& {6 m+ U1 \+ h" N- S  
# [9 h9 l' `8 S  /* Configure the system Power */
: x% u. J! r: f+ {# S' P+ W  SystemPower_Config();
1 A5 b5 C: n" t0 n6 i/ \5 j9 N& \& l1 m
# w1 T+ w" a9 f) f  while (1)9 B6 m4 r5 n/ o# h( R1 E0 f
  {# b4 T/ J' |& D; F' L" U# D
    /* Insert 5 second delay */' H' [+ \8 b* c, T
BSP_LED_Init(LED2);        //LED初始化 7 @% o6 h/ V; `2 \7 q
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);        //点亮LED,延时3S,再灭LED
% J. _0 b9 Q4 D  v: e) z. o    HAL_Delay(3000);4 w4 r4 E! j: x, @6 Q/ `
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);1 U+ O. Q. p1 `/ q
    HAL_Delay(3000);
! I( `0 a6 c5 G. u  DSystemPower_Config();        //关闭所有IO和时钟
, [9 H. Q; S2 ~. ~    /* Key button (EXTI_Line13) will be used to wakeup the system from STOP mode */
6 |7 @; `* N) t) P6 g$ F! w% W4 c    BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
2 B0 x0 x! n% B8 u7 f2 }  i+ u4 D% f/ J
    /* Enter Stop Mode */  I1 r8 |9 K, v8 G
    HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);/ l! N) D" Z8 J* i( Z6 p7 Y

& r% ]% |" m( J: ~( Y    /* Configures system clock after wake-up from STOP: enable HSE, PLL and select4 G, e' C; H( {, U. ^6 k
    PLL as system clock source (HSE and PLL are disabled in STOP mode) */
& a9 b  `7 n/ I  o" D    SystemClockConfig_STOP();9 C3 u) V0 @' {
  }: w4 b6 _) @0 G. U; t
}
+ e, d) e. v6 I/ d4 O: q& B
1.png
2.png
3.jpg

3 o5 Y% ?+ |1 |5 I3 ^
, S0 V$ b2 r9 p8 Z& K, r

PWR_STOP.rar

下载

4.01 MB, 下载次数: 45

赞 收藏 评论18 发布时间:2019-1-25 13:16

举报

18个回答
mmuuss586 回答时间:2019-5-7 09:47:39
% R. i/ Q% Y! m: S* ~2 P
感谢支持
generalcircuits 回答时间:2019-7-26 11:15:23
谢谢分享!参考学习
mmuuss586 回答时间:2019-7-27 11:32:59
谢楼上支持
mmuuss586 回答时间:2019-1-25 13:16:59
:)
Paderboy 回答时间:2019-1-25 13:50:32
多谢分享
mmuuss586 回答时间:2019-1-25 14:41:34

6 j% N4 P% m$ h* I7 B" s2 ]* A/ G谢版主支持
Kevin_G 回答时间:2019-1-26 16:26:12
参考下
mmuuss586 回答时间:2019-1-27 10:09:56

1 y  t6 U& w; S* b* _谢楼上支持
mmuuss586 回答时间:2019-2-3 20:11:56
拙夫 回答时间:2019-5-7 09:15:31
mmuuss586 回答时间:2019-6-18 12:45:36

7 b- m& H5 B* T- Y2 S0 V2 S学习学习
mmuuss586 回答时间:2019-7-26 09:22:24
:D:D:D
mmuuss586 回答时间:2019-8-16 09:18:57
:D:D
mmuuss586 回答时间:2019-10-4 13:30:57
12下一页
关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
人形机器人运动控制、感知与智能配电
半导体创新技术与应用方向
EE架构与软件定义汽车
12V/48V 汽车智能配电(SPD)
区域控制单元(ZCU)与分区架构
关注我们
st-img 微信公众号
st-img 手机版