Embeded/ATmega128 썸네일형 리스트형 2010년 10월 14일 목요일 (FND컨트롤) #include int main() { DDRC = 0x00; DDRE = 0xff; volatile unsigned char a=0; volatile unsigned char R=0; volatile unsigned char L=0; for(;;) { asm("NOP"); R=0x00; L=0x00; a=0; while(1){ if(9>=a) { //PORTE=R; _delay_ms(200); a++; R++; } else if(0x99>=R) { a=0; R=0; L=L+0x10; R=L; } else { a=0; R=0; L=0; } PORTE=R; }} return 0; } /* 00~99까지 증가 FND #include int main() { DDRC = 0x00; DDRE = 0xff; vol.. 더보기 2010년 10월 13일 수요일 하버드 ☜ data bus : 8bit, adress bus : 16bit, RISC, 133개의 명령어 PIN ☜ Port A~F 까지는 8bit G만 5bit 총 54개 char : 1byte. int : 2byte. float : 4byte. long : 4byte. dubble : 4byte. *(포인트) : 2byte. 더보기 2010년 10월 12일 화요일 I/O reg 3가지 DDRx : 데이터 입출력 방향 PORTx : 데이터 출력 PINx : 포트x로 들어오는 입력값 포트F 출력용 사용 #include int main() { DDRF = 0xFF; //F포트를 출력으로 설정 PORTF = 0x00; //F포트의 LED on return 0; } 더보기 이전 1 2 다음