|
http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=23727 [복사]
#include<avr/io.h>
unsigned int data=0xFE;
void main(void)
{
DDRB=0xFF;
PORTB=0xFF;
DDRB|=0xFB;
GICR|=0x40;
MCUCR=0x02;
MCUCSR=0x00;
GIFR=0x40;
__enable_interrupt();
while(1);
}
#pragma vector=INTO_vect
__interrupt void INTO_interrupt(void)
{
__disable_interrupt();
PORTB=data;
data--;
__enable_interrupt();
}
저희 마이크로 컨트롤러(AVR) 수업이있는데요 ,,,ㅠㅠ
이 프로그램이 어떻게 돌아가는지 교수님께 말씀드려야하는데,.
이해가 안가는 부분도 많구요...
STUDIO4 로 파일 돌려봐도 ERROR 1 나가 뜨는데,. 잘 못 잡겠습니다..
고수님들 설명 OR 작동 도게끔 좀 도와 주시면 안될까요 ㅠㅠ
부탁 드리겠습니다,
에러가뜨는부분은 이부분인데 수정부탁드립니다.
Build started 13.5.2012 at 19:19:10
avr-gcc -mmcu=atmega16 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT exam5-1.o -MF dep/exam5-1.o.d -c ../exam5-1.c
../exam5-1.c:5: warning: return type of 'main' is not 'int'
../exam5-1.c: In function 'main':
../exam5-1.c:10: error: 'TDDRB' undeclared (first use in this function)
../exam5-1.c:10: error: (Each undeclared identifier is reported only once
../exam5-1.c:10: error: for each function it appears in.)
../exam5-1.c:18: warning: implicit declaration of function '__enable_interrupt'
../exam5-1.c: At top level:
../exam5-1.c:26: warning: ignoring #pragma vector
../exam5-1.c:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
make: *** [exam5-1.o] Error 1
Build failed with 4 errors and 3 warnings...
|
Hit : 11144 Date : 2012/05/13 07:55
|