1VLSI Design Lab.
AVR Studio 사용법
Konkuk Univ. VLSI Design Lab.
2VLSI Design Lab.
컴퓨터에 설치 하기
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 여기서 AVR STUDIO 4를 다운 받고설치
AVRISP Programmer(USB Cable이 연결된 별도의 소형보드)를 USB Port에 꽂으면 Driver를 요구하는데www.ftdichip.com에서(FT232R) Download하여 Driver를 설치 위의 드라이버는 홈페이지에 있습니다.
http://sourceforge.net/project/showfiles.php?group_id=68108
다운 받은 후 WINAVR을 설치 합니다.
3VLSI Design Lab.
AVR Studio
4VLSI Design Lab.
AVR Studio ‐ Creating New project
5VLSI Design Lab.
AVR Studio ‐ Creating New project
작업하는 프로그램경로 설정
6VLSI Design Lab.
AVR Studio ‐ Creating New project
7VLSI Design Lab.
AVR Studio ‐ Creating New project
여기서 코딩해도 되고
본인이 작업한 파일을추가해도 됨
8VLSI Design Lab.
AVR Studio ‐ Creating New project
9VLSI Design Lab.
AVR Studio ‐ Creating New project
현재 우리가 사용하는 보드에 맞게 셋팅
보드에 11.0592Mhz=11059200Hz
10VLSI Design Lab.
AVR Studio ‐ Coding
How to write a simple Input and Output Program for AVR Atmega128 microcontroller
while(1){
for(i = 0; i < 8; i++){
_delay_ms(200);PORTD = PORTD << 1;
// 1 each Shift }
PORTD = 0x01;}return 0;
}
while(1){
for(i = 0; i < 8; i++){
_delay_ms(200);PORTD = PORTD << 1;
// 1 each Shift }
PORTD = 0x01;}return 0;
}
#include <avr/io.h>#include <util/delay.h>#define F_CPU 11059200UL
int main(void){
unsigned int i;DDRD = 0xff;
//Port D outputPORTD = 0x01;
//(0000 0001)
‘1’ LED On‘0’ LED Off
11VLSI Design Lab.
AVR Studio ‐ Build
Build를 하면아래와 같은 메시지가 나온다.
12VLSI Design Lab.
AVR Studio ‐ Downloading the program
13VLSI Design Lab.
AVR Studio ‐ Downloading the program
COM포트 확인은 장치 관리자
14VLSI Design Lab.
AVR Studio ‐ Downloading the program
Cancel button
15VLSI Design Lab.
AVR Studio ‐ Downloading the program
본인이 작업한 프로젝트 파일에서 .hex파일 선택
16VLSI Design Lab.
AVR Studio ‐ Downloading the program
버튼을 누르면 본인이 작성한코드가 보드에 다운로드 된다
이 때 스위치는꼭 오른쪽(ISP)
방향 유지