17
KyungHee Univ. 2-1 Parallel Port LCD Interface with the HD44780 Controller

PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

  • Upload
    lyphuc

  • View
    215

  • Download
    3

Embed Size (px)

Citation preview

Page 1: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-1

Parallel Port LCD Interface with the HD44780 Controller

Page 2: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-2

Liquid Crystal Display LCD 의 장점

소비 전력이 작다 . 용이하게 다양한 모양 ( 문자 , 그림 등 ) 을 만들 수 있다 .

LCD 는 오직 AC 로 구동하여야 한다 .이 회로 에서는 Control 신호가 High 일 때만 VLCD 가 인가

되어 Display 된다 .

Page 3: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-3

Liquid Crystal Display LCD 제어 신호 Timing 예

Page 4: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-4

Scanned LCD Interface

FP1 FP2BP1

f a

BP2

g b

BP3

e c

BP4

d h

LCD Artwork 예 특정 Segment 의 Front-plane 과 Back-plane 사이에 일정 전압

이상이 인가 된 경우 해당 Segment 가 표시 된다 .

Page 5: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-5

Scanned LCD Interface각 Segment 는 Front-plane 과 Back-plane 의 조합에 의하여 On/Off 가 제어 된다 .

Page 6: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-6

HD44780 Block Diagram

Page 7: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-7

Function Description Registers

Instruction register (IR) : Stores instruction codes display clear, cursor shift, Address information

• Display data RAM (DDRAM)• Character generator RAM (CGRAM)

Data register (DR) : DDRAM 이나 CGRAM 에 Read/Write 하는 Data 을 임시로 저장

Busy Flag (BF)HD44780 가 내부 동작 모드일 경우 (Busy 상태 ) 에는 다음

명령을 받을 수 없다 .Busy Flag 는 DB7 에 Output 된다 .

Address Counter (AC)DDRAM 이나 CGRAM 의 Address 를 저장

Page 8: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-8

Function Description

Registers Selection

RS R/~W Operation0 0 IR write as an internal operation (display

clear, etc.)0 1 Read busy flag (DB7) and address counter

(DB0 to DB6)1 0 DR write as an internal operation (DR to

DDRAM or CGRAM)1 1 DR read as an internal operation (DDRAM

or CGRAM to DR)

InstructionD

ata

Page 9: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-9

Display Data RAM (DDRAM) Display data RAM(DDRAM) 은 80 x 8 bits(80 자 ) 를

저장 DDRAM address (ADD)

1-Line Display(N=0)

1-Line Display 예Shift LeftShift Right

Page 10: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-10

Display Data RAM (DDRAM) 2-line display (N = 1)

2-Line 8 Character Dis-play

2-Line 16 Character Dis-play

10 진수

16 진수

16 진수

Page 11: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-11

Instructions

Page 12: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-12

Instructions

Page 13: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-13

Parallel Port LCD Module Interface 예

Page 14: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-14

123456789

10111213141516

GND -+5V -

PA1 -PA2 -PA3 -

- - - -

PA4 -PA5 -PA6 -PA7 -

- -

- Vss- Vdd- V0- RS- R/W- E- DB0- DB1- DB2- DB3- DB4- DB5- DB6- DB7- A- K

- GND- Power supply- Contrast adjustment- Register select signal- Read/Write selection- Enable signal

- Backlight( +)- Backlight( - )

LCD 모듈 4Bit Interface 예 (Port A 사용 )

AVR Pin NO. Symbol Function

10K

GND

+5V

Backlight 밝기 조절에 브릿지 다이오드를 사용 하고 , 점퍼 SW 로 밝기를 선택 하도록 하였다 .Backlight 회로는 생략 할 수 있음 .

Page 15: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-15

Parallel Port LCD Interface with the HD44780 Controller

HD44780 Controller 의 Access Type 과 Timing Diagram

E

RS

R/W

Data

RS R/W Cycle0 0 Write to Instruction

Rg0 1 Read busy flag (DB7)

and address counter (DB0 to DB6)

1 0 Write data from uP to the HD44780

1 1 Read data from HD44789 to the uP

Page 16: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-16

Parallel Port LCD Interface 프로그램 예

Cho_LCD_1602_4bit_soft 프로그램 참고

Page 17: PowerPoint Presentationchowk.khu.ac.kr/lecture/AVR/lecture_note_… · PPT file · Web view · 2017-11-07LCD 는 오직 AC로 구동하여야 한다. 이 회로 에서는 Control

KyungHee Univ. 2-17

Parallel Port LCD Interface with the HD44780 Controller

// PA1 PA2 PA3 PA4-PA7// RS R/W E DB0-DB3 DB4-DB7// // Register Selection // Read/Write// Enable// NoConnection// Data Bus

#define LCD_INST_W 0x00#define LCD_INST_R 0x04#define LCD_DATA_W 0x02#define LCD_DATA_R 0x06#define LCD_COLTROL_E 0x08

Internal definitions and Port