the practice of micro-processor yonam institute of digital technology 06. lcd control

9
The Practice of Micro- processor Yonam Institute of Digital Technology 06. LCD Control

Upload: chana-liggins

Post on 01-Apr-2015

222 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

The Practice of Micro-processor

Yonam Institute of Digital Technology

06. LCD Control

Page 2: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

2

LCD (Liquid Cristal Display) LCD module constructs display device and its controller Using of LCD module easy and simple In Industry, the LCD module is useful device for

indication of variety device’s information

16X2 character LCD uses 4 for data in/out put port uses 3 for control signal

Overview of LCDOverview of LCD

Page 3: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

Test-Board contains 16x2 character LCD

LCD in Test BoardLCD in Test Board

3

  

  

Port Specify

PC.4~7 LCD data line, Data I/O

PC.0~2 LCD control signal

Page 4: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

Arrangement of Key Matrix Components

4

PC.0 ●

PC.1 ●

PC.2 ●

PC.3 ●

PC.4 ●

PC.5 ●

PC.6 ●

PC.7 ●

● C.0

● C.1

● C.2

● C.3

● L.0

● L.1

● L.2

● L.3

8583PC PORT

Key MatrixPart

1. 16X2 CLCD2. LCD Light Adjust3. LCD Data Port4. LCD Control Port

Page 5: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

5

Wiring Diagram

  

AVR8535MCU Module

Multi DigitalBreadboard

PC.0 ●

PC.1 ●

PC.2 ●

PC.3 ●

PC.4 ●

PC.5 ●

PC.6 ●

PC.7 ●

● RS

● R/W

● E

● D0

● D1

● D2

● D3

● D4

● D5

● D6

● D7

8583PA PORT

LCDPart

LCDPart

Page 6: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

Practice of LCD ControlPractice of LCD Control

LCD에 다음과 같이 출력

6

A V R A T M e g a 8 5 3 5 L

Y o n a m - a c . k r C I S

Page 7: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

  

7

#include <90s8535.h>

#asm .equ __lcd_port=0x15#endasm

#include <lcd.h>

void init(void);void delay(unsigned int cnt);void main(void) {

char buff[17]="AVR ATMega 8535L"; // LCD 출력  Data 저장 변수 설정

PORTC=0x00; // outputDDRC=0xFF;

lcd_init(16); // Character LCD 16 * 2 사용 선언         lcd_gotoxy(0,0); // LCD 1 line 선택 함수 , x=0, y=0 delay(100); // 시간 지연 함수        lcd_puts(buff); // buff변수  Data를  LCD로 출력 

lcd_gotoxy(0,1); // LCD 2 line 선택 함수 , x=0, y=1lcd_putsf(" Yonam-ac.kr CIS"); // Data를  LCD로 출력

}

void delay(unsigned int cnt) {while(cnt--);

}

Page 8: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

Advanced PracticeAdvanced Practice

LCD, 7-Segment, Key Matrix 이용 과제

Key Matrix와  7-Segment를 이용한 계산기 만들기 숫자 키 사용 문자 키 연산 기호로 사용

A(+), B(-), C(*), D(/), E(=) 결과값  7-Segment로 출력

Key Matrix에서 입력한 키 값을  7-Segment로 출력하는 프로그램을 수정하여 동시에  LCD에도 표시하기

8

A V R A T M e g a 8 5 3 5 L

Page 9: The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control

Key Matrix와  7-Segment 그리고  LCD를 이용한 계산기 숫자 키 사용 문자 키 연산 기호로 사용

A(+), B(-), C(*), D(/), E(=) 입력 숫자는  7-Segment로 출력 출력될 연산결과는  LCD로 출력  ( 위치  2Line 첫 번째 )