#define DDRA (*((volatile unsigned char *)0x21))
#define PORTA (*((volatile unsigned char *)0x22))
#define PINA (*((volatile unsigned char *)0x20))
#define EICRA (*((volatile unsigned char *)0x69))
#define EIMSK (*((volatile unsigned char *)0x3D))
#define SREG (*((volatile unsigned char *)0x5F))
#define INT7 7
#define INT6 6
#define INT5 5
#define INT4 4
#define INT3 3
#define INT2 2
#define INT1 1
#define INT0 0
#define ISC7 6
#define ISC6 4
#define ISC5 2
#define ISC4 0
#define ISC3 6
#define ISC2 4
#define ISC1 2
#define ISC0 0
#define sei() __asm__ __volatile__ ("sei" ::)
//어셈블리 명령어로써 특정7번만 불러옴
#define sleep() __asm__ __volatile__ ( "sleep" "\n\t" :: )
void __vector_1 (void) __attribute__((signal, used, externally_visible));
int main(void)
{
DDRA = 0xFF;
PORTA = 0x00;
EICRA = (3<<ISC0); //상승인자 ISC0 = INT0 (20<<ISC2)|(3<<ISC0);INT2=ISC2
EIMSK = (1<<INT0); //<인터럽트 0의 문을염 3번을 열어야하면 1<<INT3
SREG = SREG|(1<<INT7); // = sei();
sleep();
while(1)
{
}
return 0;
}
void __vector_1 (void)
{
PORTA = ~PORTA;//~ 이게 필드임필드
}
'코스웨어 > 16년 스마트컨트롤러' 카테고리의 다른 글
20160311-조재찬-업무일지-펌웨어분석 (2) | 2016.03.15 |
---|---|
20160314_장진웅_업무일지_펌웨어 분석 (4) | 2016.03.15 |
인터럽트 (0) | 2016.03.14 |
인터럽트 (0) | 2016.03.14 |
20160311_김도관_업무일지_Artmega_7Segment & LED8개 교차점멸 (4) | 2016.03.14 |
2016.03.08 민경호 업무일지 - 파일 입출력 (1) | 2016.03.14 |
20160310-허도경-CPU모듈2 (3) | 2016.03.13 |
20160311_송민규_업무일지_펌웨어분석 (6) | 2016.03.13 |