这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 基础知识 » GCC,AMEG8 用GCC编译的AMEG8中的休眠指令是?

共3条 1/1 1 跳转至

GCC,AMEG8 用GCC编译的AMEG8中的休眠指令是?

院士
2006-09-17 18:14:16     打赏
GCC,AMEG8 用GCC编译的AMEG8中的休眠指令是?



关键词: AMEG8     编译     中的     休眠     指令    

院士
2006-12-22 22:43:00     打赏
2楼
问         用GCC编译的AMEG8中的休眠指令是什么?我用SLEEP为什么不能通过? 1: 看gcc的手册5.5 Power Management and Sleep Modes
5.5.1 Detailed Description
#include <AVR/sleep.h>
Use of the SLEEP instruction CAN allow your application to reduce it’s power com-sumption
considerably. AVR devices CAN be put into different sleep modes by chang-ing
the SMn bits of the MCU Control Register ( MCUCR ). Refer to the datasheet for the
details relating to the device you are using.
Sleep Modes
Note:
Some of these modes are not available on all devices. See the datasheet for target
device for the available sleep modes.
&#8226; #define SLEEP MODE IDLE 0
&#8226; #define SLEEP MODE ADC BV(SM0)
&#8226; #define SLEEP MODE PWR DOWN BV(SM1)
&#8226; #define SLEEP MODE PWR SAVE ( BV(SM0) | BV(SM1))
&#8226; #define SLEEP MODE STANDBY ( BV(SM1) | BV(SM2))
&#8226; #define SLEEP MODE EXT STANDBY ( BV(SM0) | BV(SM1) | BV(SM2))
Sleep Functions
&#8226; void set sleep mode (uint8 t mode)
&#8226; void sleep mode (void)
2: 是啊,要用setsleepmode()和sleepmode()才行或者这样也可以:
  asm volatile("sleep"::);
注意这之前要先设置睡眠模式。

专家
2022-08-20 16:04:00     打赏
3楼

学习学习


共3条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]