共2条 1/1
1
跳转至
页
AVR 请问各路师兄师姐:有用过AVR的5种节电模式吗?最小电流是多少?
问
答
1: 注意:還跟頻率有關.注意:還跟頻率有關.
我用過8515 頻率32.768 閑置模式 25uA 答 2: 紧急求教coke仁兄:我该怎么办?!!!!coke仁兄:我用的是mega16L,按理在掉电模式下晶振应该停振,但我用codevisiona AVRC 编译器:
#include
main(){ MCUCR=0X60; //掉电模式
#asm("sleep")
while(1);
}
却无法使 单片机进行入该方式,Vcc=3.7V时,电流仍为1.5mA,示波器观察晶振仍在运行中。请教仁兄:我的程序有问题吗?您能给我具体程序吗?是不是在进入掉电方式之前必须对IO口及其它进行设置。谢了! 答 3: 供參考.8535以前的匯編.int1喚醒.portc.portd輸出.
由于是從原來程序剪出來的.所以有點亂.供參考.
.include"8535def.inc"
.def temp=r17
.def data=r22
.org 0x0000
rjmp reset
.org 0x0002
rjmp int
.org 0x0010
reset:
ldi temp,low(ramend)
out spl,temp
ldi temp,high(ramend)
out sph,temp
ser temp
out ddrc,temp
out ddrb,temp
ldi temp,0xff
mov r5,temp
ldi temp,0x40 ;allow the sleep
out mcucr,temp
ldi temp,0x80 ;enable int1 interrupt
out gimsk,temp
ldi data,0x10
loop:
ldi temp,0x00
out portc,temp
out portb,data
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
ser temp
out portc,temp
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
dec r5
brne loop
sei
sleep ;enter sleep mode
ldi temp,0x80
out gimsk,temp
ldi temp,0xff
mov r5,temp
rjmp loop
int:
ldi data,0x90
reti
delay:
dec r4
brne delay
ret
答 4: coke,8515能用那么的频率的晶体吗?我用1M的陶瓷晶体,就不正常了阿,你是不是外部晶振? 答 5: 2313,3.3v,3.6864mhz, 掉电模式 0.67uA 答 6: sorry.sorry. 是mega8 用32.768.
不過8515也可參考他啊.
我用過8515 頻率32.768 閑置模式 25uA 答 2: 紧急求教coke仁兄:我该怎么办?!!!!coke仁兄:我用的是mega16L,按理在掉电模式下晶振应该停振,但我用codevisiona AVRC 编译器:
#include
main(){ MCUCR=0X60; //掉电模式
#asm("sleep")
while(1);
}
却无法使 单片机进行入该方式,Vcc=3.7V时,电流仍为1.5mA,示波器观察晶振仍在运行中。请教仁兄:我的程序有问题吗?您能给我具体程序吗?是不是在进入掉电方式之前必须对IO口及其它进行设置。谢了! 答 3: 供參考.8535以前的匯編.int1喚醒.portc.portd輸出.
由于是從原來程序剪出來的.所以有點亂.供參考.
.include"8535def.inc"
.def temp=r17
.def data=r22
.org 0x0000
rjmp reset
.org 0x0002
rjmp int
.org 0x0010
reset:
ldi temp,low(ramend)
out spl,temp
ldi temp,high(ramend)
out sph,temp
ser temp
out ddrc,temp
out ddrb,temp
ldi temp,0xff
mov r5,temp
ldi temp,0x40 ;allow the sleep
out mcucr,temp
ldi temp,0x80 ;enable int1 interrupt
out gimsk,temp
ldi data,0x10
loop:
ldi temp,0x00
out portc,temp
out portb,data
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
ser temp
out portc,temp
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
dec r5
brne loop
sei
sleep ;enter sleep mode
ldi temp,0x80
out gimsk,temp
ldi temp,0xff
mov r5,temp
rjmp loop
int:
ldi data,0x90
reti
delay:
dec r4
brne delay
ret
答 4: coke,8515能用那么的频率的晶体吗?我用1M的陶瓷晶体,就不正常了阿,你是不是外部晶振? 答 5: 2313,3.3v,3.6864mhz, 掉电模式 0.67uA 答 6: sorry.sorry. 是mega8 用32.768.
不過8515也可參考他啊.
共2条 1/1
1
跳转至
页
回复
有奖活动 | |
---|---|
5月直播——【探索边缘智能的未来——直播盛宴即将开启!】 | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
【有奖活动】智能可穿戴设备AR/VR如何引领科技新潮流! | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 |