회원가입 ID/PW 찾기

1) 지식 창고는 본인이 작성한 콘텐츠(팁/노하우/리소스/강좌 등)을 무료 혹은 가상화폐인 납포인트를 통해 공유하는 공간입니다.
2) 본인이 작성한 콘텐츠에 대해서만 지식 창고에 등록할 수 있으며, 저작권에 위배되는 콘텐츠는 사전경고 없이 삭제될 수 있습니다.
3) 콘텐츠 구매 및 첨부파일 다운로드는 회원그룹 '연구원' 이상 가능하오니, 경험치를 쌓아 진급한 후에 이용 부탁드립니다.
4) 무료 콘텐츠의 본문은 구매절차 없이 즉시 이용할 수 있으며, 판매 납포인트가 있는 콘텐츠는 구매 후 이용할 수 있습니다.
5) 콘텐츠 판매에 따른 납포인트 수익은 지정한 비율(50%)에 따라 판매자에게 지급하며, 납포인트 수익을 통해 진급을 빨리할 수 있습니다.
6) 구매 후 평가를 하면 구매 납포인트의 20%를 돌려 드립니다.

콘텐츠 수 23
판매자 뺘쑝 판매 납포인트 무료 평점 0점 / 총 0명 참여

#include <at89s53.h>              

#define LCD_DATA P0  // P0를 LCD 데이터를 출력하는 포트로 사용하기 위해
#define LINE1 0x80   // 1000 0000(1AAA AAAA) => 1-line DDRAM address 00H set
#define LINE2 0xC0   // 1100 0000(1AAA AAAA) => 2-line DDRAM address 40H set

sbit LCD_RS = P2^0;  // P2.0를 비트 제어하기 위해 LCD_RS 변수 선언
sbit LCD_RW = P2^1;  // P2.1를 비트 제어하기 위해 LCD_RW 변수 선언
sbit LCD_E = P2^2;   // P2.2를 비트 제어하기 위해 LCD_E 변수 선언

void delay(unsigned int d_cnt)
{
     while(d_cnt--);         // 입력된 숫자에서 1씩 감소하면서 0이 되면 while() 빠져나감
}

unsigned char LCD_read(bit cmd_select) //LCD에서 읽기
{
     unsigned char r_data;
 
     LCD_RS = cmd_select;  // 0: read busy flag & address, 1: read data
     LCD_RW = 1;           // read signal
     LCD_E = 1;            // enable
     r_data = LCD_DATA;    // P0를 통하여 데이터 읽는다.
     LCD_E = 0;            // disable
 
     return r_data;
}

void LCD_write(bit cmd_select, unsigned char w_data) //LCD에 쓰기
{
     LCD_DATA = w_data;    // LCD에 쓸 데이터를 먼저 P0로 출력
     LCD_RS =cmd_select;   // 0: write instruction, 1: write data
     LCD_RW = 0;           // write signal
     LCD_E = 1;            // enable. 실제로 LCD 내부에 입력된다.
     LCD_E = 0;            // disable
}

void LCD_busy_check(void)  // LCD busy flag check
{
     while(1)
    {
         if((LCD_read(0) & 0x80) == 0) break; 
     }
}

void init_LCD(void)  //LCD 초기화 함수
{
     delay(10000);           // wait for more than 15msec
     LCD_write(0, 0x38);  // function set, 8bit data interface, 2lines, 5x8 dots set
     delay(2000);            // wait for more than 4.1msec
     LCD_write(0, 0x38);  // function set, 8bit data interface, 2lines, 5x8 dots set
     delay(500);             // wait for more than 100usec
     LCD_write(0, 0x38);  // function set, 8bit data interface, 2lines, 5x8 dots set
     LCD_busy_check();      // busy check
     LCD_write(0, 0x38);  // function set, 8bit data interface, 2lines, 5x8 dots set
     LCD_busy_check();  
     LCD_write(0, 0x08);  // Display on/off control, LCD off, cursor off, blink off
     LCD_busy_check();  
     LCD_write(0, 0x01);  // clear display
     LCD_busy_check();  
     LCD_write(0, 0x06);  // Entry Mode set, address increment
     LCD_busy_check();  
     LCD_write(0, 0x0C);  // Display on/off control, LCD on, cursor off, blink off
}

//  8051이 명령어를 실행하기 시작하는 main() 함수        //
void main(void)                  
{
     init_LCD();   // LCD initialize
 
     LCD_busy_check();  
     LCD_write(0, LINE1);  //  DDRAM address write

     LCD_busy_check();  
     LCD_write(1, 'L');  // 'L' display
     LCD_busy_check();  
     LCD_write(1, 'C');  // 'C' display
     LCD_busy_check();  
     LCD_write(1, 'D');  // 'D' display
     LCD_busy_check();  
     LCD_write(1, ' ');  // ' ' display
     LCD_busy_check();  
     LCD_write(1, 't');  // 't' display
     LCD_busy_check();  
     LCD_write(1, 'e');  // 'e' display
     LCD_busy_check();  
     LCD_write(1, 's');  // 's' display
     LCD_busy_check(); 
     LCD_write(1, 't');  // 't' display

     while(1);   //대기
}

 

profile

profile
흑화향 2010.04.29 11:10

좋은 소스 감사드립니다.

profile
마성현 2010.05.23 23:15
좋은 자료 감사함니다
profile
시나브로69 2017.06.24 13:12
좋은 자료 감사합니다.
search
List of Articles
번호 분류 제목 평점 포인트 판매자 등록일 구매수 조회 수
공지 공공의 목적으로 공유하고자 하는 소프트웨어는 '소프트웨어 자료실'에 업로드를 요청드립니다.
공지 구매후 평점 댓글을 남겨주시면 구매포인트의 20%를 돌려드립니다.
23 EDA Simulation OrCAD PSpice - 초급자용 [40] 무료 프리미엄 2007-11-04 0 2308
22 EDA Simulation orcad 파라미터 단축키 파일입니다. [10] 무료 웨라러브 2012-03-02 0 2348
21 EDA Simulation PSpice floating 문제 [7] 무료 Interrupter 2011-09-14 0 4407
20 EDA Simulation pspice 입문하시는 분을 위해 [21] 무료 가나초콜릿 2011-02-23 0 3830
19 EDA Simulation 온도에 따른 저항 (써미스터) 시뮬레이션 [6] 무료 ANCAT 2011-02-22 0 4808
18 EDA Simulation pspice에서 질 문 이요 [1] 무료 pigu45 2011-01-31 0 2991
17 EDA Simulation part 질문좀.. [1] 무료 pigu45 2011-01-31 0 2853
16 EDA Simulation 오류 제능력 밖이라서 문의드립니다. [1] 무료 쨍용 2010-12-22 0 3161
15 EDA Simulation 정말 간단한 질문이요..ㅠㅠ [2] 무료 쨍용 2010-11-30 0 2193
14 EDA Simulation pspice 디지털입력 질문이요~ 무료 cadi 2010-11-22 0 2226
13 EDA Simulation layout92 manual [2] 무료 정상까지 가보자! 2010-11-15 0 2361
12 EDA Simulation pspice 자료입니다. [2] 무료 TreeOfDream 2010-09-09 0 3499
11 EDA Simulation pspice 자료 입니다. [9] 무료 TreeOfDream 2010-06-30 0 2507
10 EDA Simulation pspice 라이브러리가이드 메뉴얼입니다. [3] 무료 LAZEX 2010-05-26 0 3379
9 EDA Simulation 전자제도이론.. [6] 무료 양자 2010-01-20 0 2757
8 EDA Simulation OrCAD PSpice 초보자 사용법이에요 [29] 무료 월간낚시 2009-11-30 0 5817
7 EDA Simulation orcad-pspice 메뉴얼 [8] 무료 쫑~ 2009-10-27 0 3214
6 EDA Simulation Orcad Pspice 입출력 설정 [8] 무료 프리미엄 2007-11-04 0 2211
5 EDA Simulation PSpice 사용법 #4 [13] 무료 라이언상병 2007-08-20 0 2142
4 EDA Simulation PSpice 유저가이드 [13] 무료 라이언상병 2007-08-20 0 1996
  • 사랑은 왕궁에서뿐 아니라 오두막집에서도 산다.
    - J.레이
  • * 납포인트 정보 *
  • 글 작성 : 3
  • 댓글 작성 : 1
저작권법에 위배되는 콘텐츠는 등록 불가하며, 저작물에 대한 권리는 저작자에게 있습니다.
Copyright 2006-2021 © hardwareis.com, All rights reserved.