Upload
aubrey-saville
View
217
Download
1
Tags:
Embed Size (px)
Citation preview
The Practice of Micro-processor
Yonam Institute of Digital Technology
03. Preparing for Practice
Overview of Board
2
1
11
10
7
5
2
9
8
4
36
MCU module
Digital I/O
7-Segment Part
4X4 Key Matrix
LCD
Printer Port
Serial Port
MCU Port Connect
Breadboard
Power Part
Power Connector / Switch
MCU Module BoardMCU Module Board
3
2
14
5
3
6
7
1, 2: MCU ATmega8535, MCU Interface Part
3: ISP Connector (On/Off)4: PLD Part5: Reset Switch6: MCU State LED7: Power Connector
CodeVision AVR Installing Using CD
Compiler & ProgrammerCompiler & Programmer
4
Connecting Board and PCConnecting Board and PC
5
1.전원 케이블연결
2.ISP 케이블연결
3.Code VisionCompiler로HEX File 전송
Using CodeVision1. Creation New Project
Testing a LED-Control ProgramTesting a LED-Control Program
6
1. 작업폴더로 이동1. 작업폴더로 이동
2. 프로젝트 이름 작성 3. 저장 버튼 클릭
2. Configuration
1. C Compiler를 클릭 1. Atmega8535 선택
2. 3.6864MHz 설정
3. After Make 클릭
1. 체크한다.
1. OK 클릭
7
3. Creation Source
1. 클릭한다.
1. 클릭한다.
8
Sample Code
#include <90s8535.h>
void main(void)
{
DDRA = 0xFF; // Port A 출력으로 설정
PORTA = 0xFF; // Port A 초기값
while(1) { // 무한루프
PORTA = 0x80; // Port A로 0x80 값 출력
}
}
9
10
Wiring Diagram
PA.0 ● ● DO.0
PA.1 ● ● DO.1
PA.2 ● ● DO.2
8535 PA.3 ● ● DO.3 Digital
PA PORT PA.4 ● ● DO.4 Output
PA.5 ● ● DO.5
PA.6 ● ● DO.6
PA.7 ● ● DO.7
PC.0 ● ● DI.0
PC.1 ● ● DI.1
PC.2 ● ● DI.2
8535 PC.3 ● ● DI.3 Digital
PC PORT PC.4 ● ● DI.4 Input
PC.5 ● ● DI.5
PC.6 ● ● DI.6
PC.7 ● ● DI.7
AVR8535MCU Module
Multi DigitalBreadboard
11
1. Configure 선택
1. Add 버튼 클릭
1. 소스 추가 확인
2. 컴파일 실행 3. 컴파일 실행 및
ISP 다운로드 실행
Compiling & Download
Digital Output LED: 8bit digital data output VCC(Logic ‘H’)-LED on, GND(Logic ‘L’)-LED off
Uses Hex-numeric data for LED control ex: If you insert “0xAA” to port output, the result follows
Understanding Port Output (LED Understanding Port Output (LED Control)Control)
12
N.C 0 0 0 0 0 0 0 0 N.C N.C 1 0 1 0 1 0 1 0 N.C
0 0 A A
0x00 0xAA
LED가 다음과 같이 반복되게 하시오 .
LED가 다음과 같이 1bit씩 왼쪽 /오른쪽 shift하며 점등하게 하시오 .
Practice of Port Output (LED Practice of Port Output (LED Control)Control)
13
N.C 1 0 1 0 1 0 1 0 N.C N.C 0 1 0 1 0 1 0 1 N.C
…(1)
(2) …
Practice of Port Output (LED Practice of Port Output (LED Control)Control)
LED가 다음과 같이 1bit씩 누적되어 왼쪽 /오른쪽 shift하며 점등하게 하시오 .
…(1)
(2) …
14
Digital Input DIP Switch: 8bit digital data input Turn On-GND(Logic ‘L’), Turn Off-VCC(Logic ‘H’)
Understanding Port Input (DIP Understanding Port Input (DIP Switch)Switch)
15
D7 D6 D5 D4 D3 D2 D1 D0
PC.0 ● ● DI.0
PC.1 ● ● DI.1
PC.2 ● ● DI.2
8535 PC.3 ● ● DI.3 Digital
PC PORT PC.4 ● ● DI.4 Input
PC.5 ● ● DI.5
PC.6 ● ● DI.6
PC.7 ● ● DI.7
AVR8535MCU Module
Multi DigitalBreadboard
다음과 같이 DIP 스위치의 입력을 LED로 출력하라 .
위의 프로그램을 수정하여 DIP 스위치 입력을 반전하여 LED로 출력하라 .
Practice of Port Input (DIP Switch)Practice of Port Input (DIP Switch)
16
DIP 스위치의 D0의 상태가 On일 때 LED가 ‘ 0xAA’와 ‘ 0x55’를 반복하게 하라 .
DIP 스위치의 D1의 상태가 On일 때 LED가 왼쪽 shift하게 하라 .
DIP 스위치의 D2의 상태가 On일 때 LED가 오른쪽 shift하게 하라 .
DIP 스위치의 D3의 상태가 On일 때 LED가 왼쪽 누적 shift하게 하라 .
DIP 스위치의 D4의 상태가 On일 때 LED가 오른쪽 누적 shift하게 하라 .
Advanced PracticeAdvanced Practice
17