Presentation is loading. Please wait.

Presentation is loading. Please wait.

패러럴 포트를 이용한 Text LCD 제어 6월 17일 20057037 허정수 20057036 나선웅.

Similar presentations


Presentation on theme: "패러럴 포트를 이용한 Text LCD 제어 6월 17일 20057037 허정수 20057036 나선웅."— Presentation transcript:

1 패러럴 포트를 이용한 Text LCD 제어 6월 17일 허정수 나선웅

2 목표 및 개요 목표 개요 Text LCD를 제어 스위치를 이용한 Interrupt
패러럴 포트에 Text LCD와 Toggle switch를 이용하여 Text LCD에는 사용자가 원하는 문자를 출력하고 Toggle switch로 인터럽트를 발생하여 인터럽트가 생겼다는 것을 사용자에게 알림.

3 준비물 25pin 패러럴 포트 2*16 Text LCD Toggle switch USB 케이블

4 배선 패러럴 포트 1 1 14 Vss Vdd 가변저항 Vee Rs R/W E DB0 ~ DB7 25 14 13 V USB 전원

5 LCD 모듈 제어표 제어 신호 제어 명령 실행시간 Rs R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
제어 신호 제어 명령 실행시간 Rs R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 Clear display 1 1.53 m Return home 1.53m Entry mode set I/D S 39u Display ON/OFFcontrol D C B display shift S/C R/L Funtion set DL N F Set CG RAM address CG RAM address Set DD RAM address DD RAM address read busy flag BF Address Counter 0u write to DD RAM write data 43u read from DD RAM read data

6 디바이스 드라이버 short.c shortt.c 추가 함수 void LCD_command(unsigned char)
void LCD_data(unsigned char) LCD에 문자 출력 void LCD_init() LCD 초기화

7 Text LCD LCD의 화면 출력 LCD_init()로 초기화 LCD 초기화 LCD를 사용하려면 초기화 필요 전원입력
초기화 전에 30ms이상 기다림 Function set Display On Entry mode set DD RAM Address set

8 Text LCD 초기화 초기화 명령 Function set Display On Entry mode set
데이터의 길이(D/L)을 정의(1:8bit, 0:4bit) 화면 표시 행(N)의 정의 (2행 : 1 , 1행 : 0 ) 문자 폰트(F) 지정(5*11 : 1, 5*8 : 0) Display On 화면을 켬 Entry mode set 화면의 이동 설정 DD RAM address set 글자 표시 위치 지정

9 Text LCD 사용상 주의 사항 Enable 6번 pin인 E LCD가 일을 수행하기 위한 Trigger
LCD는 PC나 Micro Controler에 비해 현저히 느림 명령어 셋을 LCD의 메모리에 넣은 다음 꼭 충분한 시간과 Enable을 On

10 프로그램 (1) LCD_control(unsigned char comm) LCD제어 명령어를 보냄.
void LCD_control(unsigned char comm) { udelay(1000); outb(0x00, short_base + 2 ); udelay(500); outb(comm, short_base); outb(0x09, short_base + 2); outb(0x00, short_base + 2); }

11 프로그램 (2) LCD_data(unsigned char comm) LCD에 출력하기 위한 데이터 보냄.
void LCD_data(unsigned char data) { outb(0x04, short_base+2); udelay(500); outb(data, short_base); outb(0x07, short_base+2); udelay(1000); }

12 프로그램 (3) LCD_init() LCD의 초기화. void LCD_init()
{ char chReady[] = "Ready!!"; outb(0x06, short_base+2); outb(0x04, short_base+2); LCD_command(0x38); udelay(500); udelay(1000); LCD_command(0x38); //Function seti LCD_command(0x0F); //Display On LCD_command(0x06); //Entry mode set LCD_command(0x80); // Set DD RAM Address LCD_command(0x01); // clear LCD convert_str(chReady,7); LCD_command(0xC0); LCD_data('A'); LCD_data('B'); } LCD_init() LCD의 초기화.

13 프로그램 (3) convert_str(const *buf, size_t count) 문자열 출력
void convert_str(const char *buf,size_t count) { int length = count; if (!buf) return; for ( count = 0 ; count < length ; count++ ) LCD_data(buf[count]); }

14 테스트 (1) 테스트 상의 문제점 상황 초기에는 화면에 출력이 되었음 인터럽트 실험 이후 화면에 출력 안됨
LCD의 초기화 안됨 패러럴 케이블 이상 없음 배선 문제 없음

15 테스트 (2) 해결을 위한 행동 케이블 변경 배선 다시 함 프로그램 처음부터 다시 코딩 결과 LCD의 오동작

16 결론 실험 실패 참고 자료 LCD의 초기화 불가능 LCD 제어와 패러럴 포트의 사용 8051마스터, Ohm사 윤덕용저
미쳐 알아내지 못한 중요한 사항 참고 자료 8051마스터, Ohm사 윤덕용저 LINUX Divece Driver, O’Reilly C가 미는 로봇, Ohm사


Download ppt "패러럴 포트를 이용한 Text LCD 제어 6월 17일 20057037 허정수 20057036 나선웅."

Similar presentations


Ads by Google