请帮我看下:为什么在AVR Studio 6.1中编译的文件在Atmega 16A中不执行?非常感谢
时间:10-02
整理:3721RD
点击:
/*单片机型号为Atmega 16A,晶振12M,熔丝位设置的为使用外部晶振。我用ICCAVR编译的类似程序就可以运行*/
#include <avr/io.h>
#include <util/delay.h>
#define uchar unsigned char
#define uint unsigned int
#define BIT(x) (1<<(x))
int main(void)
{
uchar i;
DDRD|=BIT(0);
while(1)
{
for(i=0;i<8;i++)
{
PORTD&=BIT(i);
_delay_ms(100);
}
}
}
#include <avr/io.h>
#include <util/delay.h>
#define uchar unsigned char
#define uint unsigned int
#define BIT(x) (1<<(x))
int main(void)
{
uchar i;
DDRD|=BIT(0);
while(1)
{
for(i=0;i<8;i++)
{
PORTD&=BIT(i);
_delay_ms(100);
}
}
}
从程序上了来看,程序本身肯定是没有问题的。最大的可能是熔丝位没有设置正确,还有就是在AVR Studio 6.1中,设备设置成Atmega16A的对应型号了吗?
你看看我的熔丝位设置是不是正确的,还有编译情况(选择的单片机是Atmega16A,其实跟16差不多)


兄弟,问题已经解决,谢谢你的回答!
解决了问题就好
