谁能帮我看看用icc avr编写的让pb口灯亮c语言程序,开始学习avr,这程序是设置芯片后icc avr给的
在protues上i/o口全是高阻状态,不会弄啊,手上资料也没得多少!望高手帮忙include<iom128v.h>#include<macros.h>voidport_...
在protues上i/o口全是高阻状态,不会弄啊,手上资料也没得多少!望高手帮忙
include <iom128v.h>
#include <macros.h>
void port_init(void)
{
PORTB = 0xFF;
DDRB = 0xff;
}
//call this routine to initialize all peripherals
void init_devices(void)
{
//stop errant interrupts until set up
CLI(); //disable all interrupts
XDIV = 0x00; //xtal divider
XMCRA = 0x00; //external memory
port_init();
MCUCR = 0x00;
EICRA = 0x00; //extended ext ints
EICRB = 0x00; //extended ext ints
EIMSK = 0x00;
TIMSK = 0x00; //timer interrupt sources
ETIMSK = 0x00; //extended timer interrupt sources
SEI(); //re-enable interrupts
//all peripherals are now initialized
}
void main()
{ port_init;
init_devices;} 展开
include <iom128v.h>
#include <macros.h>
void port_init(void)
{
PORTB = 0xFF;
DDRB = 0xff;
}
//call this routine to initialize all peripherals
void init_devices(void)
{
//stop errant interrupts until set up
CLI(); //disable all interrupts
XDIV = 0x00; //xtal divider
XMCRA = 0x00; //external memory
port_init();
MCUCR = 0x00;
EICRA = 0x00; //extended ext ints
EICRB = 0x00; //extended ext ints
EIMSK = 0x00;
TIMSK = 0x00; //timer interrupt sources
ETIMSK = 0x00; //extended timer interrupt sources
SEI(); //re-enable interrupts
//all peripherals are now initialized
}
void main()
{ port_init;
init_devices;} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询