求救马老师
马老师,这是我48V休眠模式的一个程序,怎么进入到休眠以后功耗掉不下来的呢???急死了。。。。。
还有一片芯片我烧写了一下掉电模式,结果芯片就不能再下载了,有什么解救办法呀。。。。。
#include<iom48v.h>
#include<macros.h>
#define uchar unsigned char
#define uint unsigned int
#define ulint unsigned long
#define _nop() asm("nop")
delay(ulint n )
{
while(n)
n--;
}
main()
{
DDRB=0x00;
PORTB=0xff;
DDRC=0x00;
PORTC=0xff;
DDRD=0x00;
PORTD=0xff;
DDRC=0x00;
DDRC|=BIT(0);
PCICR=0x02;
PCMSK2=0x00;
PCMSK1=0x06;
PCMSK0=0x00;
SEI();
delay(6000);
CLKPR=0x80;
CLKPR=0x08;
SMCR=0xc0; //STANDBY1模式
SMCR|=BIT(0);
asm ("sleep" ); //进入休眠
while(1)
{
CLKPR=0x80;
CLKPR=0x00;
PORTC=0x01;
delay(50000);
PORTC&=~BIT(0);
delay(50000);
}
}
#pragma interrupt_handler pc1_com:5
pc1_com()
{
SMCR&=~BIT(0);
PORTD=0xfe;
}
#pragma interrupt_handler pc2_com:6
pc2_com()
{
SMCR&=~BIT(0);
PORTD=0xef;
} 你老人家肯定熔丝位写错了.检查晶振熔丝 外部7M晶振 求救马老师。。。
呵呵。。
页:
[1]