회원가입 ID/PW 찾기

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

콘텐츠 수 23
판매자 심야땜쟁이 판매 납포인트 무료 평점 0점 / 총 0명 참여

LG2401281 ( Driver - T6963C ) LCD Source Code 입니다.
ATmega128 사용했고, Compiler는 Codevision AVR 2.04.4a 입니다.

---------------------------------------------------------------------------------------------------------------------------------------

#define T6963C_COMMAND_SetCursorPointer         0b00100001
#define T6963C_COMMAND_SetOffsetRegister        0b00100010
#define T6963C_COMMAND_SetAddressPointer        0b00100100

#define T6963C_COMMAND_SetTextHomeAddress       0b01000000
#define T6963C_COMMAND_SetTextArea              0b01000001
#define T6963C_COMMAND_SetGraphicHomeAddress    0b01000010
#define T6963C_COMMAND_SetGraphicArea           0b01000011

#define T6963C_COMMAND_WriteMode                0b10000000
    // bit 2~0 : 0x00 - OR Mode
    // bit 2~0 : 0x01 - EXOR Mode
    // bit 2~0 : 0x03 - AND Mode
    // bit 2~0 : 0x04 - Text Attribute Mode
    // bit 3 : 0 - CG ROM Mode
    // bit 3 : 1 - CG RAM Mode
   
    #define WRITE_MODE_OR_MODE                  0x00
    #define WRITE_MODE_EXOR_MODE                0x01
    #define WRITE_MODE_AND_MODE                 0x03
    #define WRITE_MODE_TEXT_ATTRIBUTE_MODE      0x04
    #define WRITE_MODE_CG_RAM_MODE_ON           0x08

    #define T6963C_COMMAND_SetModeOR                0b10000000
    #define T6963C_COMMAND_SetModeEXOR              0b10000001
    #define T6963C_COMMAND_SetModeAND               0b10000011
    #define T6963C_COMMAND_SetModeTextAttribute     0b10000100
    #define T6963C_COMMAND_SetModeCGROM             0b10000000
    #define T6963C_COMMAND_SetModeCGRAM             0b10001000
   

#define T6963C_COMMAND_DisplayMode              0b10010000
    // bit 3 : Graphic On
    // bit 2 : Text On
    // bit 1 : Cursor On
    // bit 0 : Blink On
   
    #define DISPLAY_MODE_GRAPHIC_ON             0x08
    #define DISPLAY_MODE_TEXT_ON                0x04
    #define DISPLAY_MODE_CURSOR_ON              0x02
    #define DISPLAY_MODE_BLINK_ON               0x01
   
    #define T6963C_COMMAND_SetDisplayOff            0b10010000
    #define T6963C_COMMAND_SetCursorOnBlinkOff      0b10010010
    #define T6963C_COMMAND_SetCursorOnBlinkOn       0b10010011
    #define T6963C_COMMAND_SetTextOnGraphicOff      0b10010100
    #define T6963C_COMMAND_SetTextOffGraphicOn      0b10011000
    #define T6963C_COMMAND_SetTextOnGraphicOn       0b10011100
                                      
#define T6963C_COMMAND_SetCursorLine            0b10100000
    // bit 2~0 : 0x00 - 1 Line Cursor
    // bit 2~0 : 0x01 - 2 Line Cursor
    // bit 2~0 : 0x02 - 3 Line Cursor
    // bit 2~0 : 0x03 - 4 Line Cursor
    // bit 2~0 : 0x04 - 5 Line Cursor
    // bit 2~0 : 0x05 - 6 Line Cursor
    // bit 2~0 : 0x06 - 7 Line Cursor
    // bit 2~0 : 0x07 - 8 Line Cursor
   
    #define CURSOR_LINE_1                           0x00
    #define CURSOR_LINE_2                           0x01
    #define CURSOR_LINE_3                           0x02
    #define CURSOR_LINE_4                           0x03
    #define CURSOR_LINE_5                           0x04
    #define CURSOR_LINE_6                           0x05
    #define CURSOR_LINE_7                           0x06
    #define CURSOR_LINE_8                           0x07

    #define T6963C_COMMAND_SetCursorLineTo1         0b10100000
    #define T6963C_COMMAND_SetCursorLineTo2         0b10100001
    #define T6963C_COMMAND_SetCursorLineTo3         0b10100010
    #define T6963C_COMMAND_SetCursorLineTo4         0b10100011
    #define T6963C_COMMAND_SetCursorLineTo5         0b10100100
    #define T6963C_COMMAND_SetCursorLineTo6         0b10100101
    #define T6963C_COMMAND_SetCursorLineTo7         0b10100110
    #define T6963C_COMMAND_SetCursorLineTo8         0b10100111
   
#define T6963C_COMMAND_SetDataAutoWrite         0b10110000
#define T6963C_COMMAND_SetDataAutoRead          0b10110001
#define T6963C_COMMAND_SetAutoReset             0b10110010

#define T6963C_COMMAND_SetDataWriteIncreseADP   0b11000000
#define T6963C_COMMAND_SetDataReadIncreseADP    0b11000001
#define T6963C_COMMAND_SetDataWriteDecreseADP   0b11000010
#define T6963C_COMMAND_SetDataReadDecreseADP    0b11000011
#define T6963C_COMMAND_SetDataWriteMaintainADP  0b11000100
#define T6963C_COMMAND_SetDataReadMaintainADP   0b11000101

#define T6963C_COMMAND_SetScreenPeek            0b11100000
#define T6963C_COMMAND_SetScreenCopy            0b11101000

#define T6963C_COMMAND_SetBitReset              0b11110000
#define T6963C_COMMAND_SetBitSet                0b11111000

#define T6963C_COMMAND_SetSelectBit0            0b11110000
#define T6963C_COMMAND_SetSelectBit1            0b11110001
#define T6963C_COMMAND_SetSelectBit2            0b11110010
#define T6963C_COMMAND_SetSelectBit3            0b11110011
#define T6963C_COMMAND_SetSelectBit4            0b11110100
#define T6963C_COMMAND_SetSelectBit5            0b11110101
#define T6963C_COMMAND_SetSelectBit6            0b11110110
#define T6963C_COMMAND_SetSelectBit7            0b11110111 
                              
#define DATADIR_IN          0x00                     
#define DATADIR_OUT         0xFF
                     
#define T6963C_DATADIR      DDRA        
#define T6963C_DATAIN       PINA
#define T6963C_DATAOUT      PORTA

#define T6963C_WR           PORTC.4
#define T6963C_RD           PORTC.5
#define T6963C_CE           PORTC.2
#define T6963C_CD           PORTC.3
#define T6963C_RST          PORTC.0
#define T6963C_FS           PORTC.1
#define T6963C_BK           PORTC.7 
               
#define T6963C_Graphic_RAM_Area     0x0000                                 
    #define T6963C_Graphic_Screen0      0x0000
    #define T6963C_Graphic_Screen1      0x0F00
    #define T6963C_Graphic_Screen2      0x1E00
    #define T6963C_Graphic_Screen3      0x2D00 
   
    #define SCREEN_0                    0
    #define SCREEN_1                    1
    #define SCREEN_2                    2
    #define SCREEN_3                    3

#define T6963C_Attribute_RAM_Area   0x3C00
#define T6963C_Text_RAM_Area        0x4000
#define T6963C_CG_RAM_Area          0x7C00
                                           
TypeUnionWord GRAPHIC_HOME_ADDRESS;
TypeUnionWord TEXT_HOME_ADDRESS;
TypeUnionWord GRAPHIC_ADDRESS;        

byte GRAPHIC_AREA = 0x1E;       // 8 bit Interval Division 30 x 8 = 240
byte TEXT_AREA = 0x1E;          // 8 bit Interval Division 30 x 8 = 240 
byte OFFSET_RESISTER = 0x0F;    // CG RAM Address is 0x7800 ~ 0x7FFF

#define PIXEL_ON                    1
#define PIXEL_OFF                   0

flash byte MaskTable[] = { 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 };
                      
// STATUS.0 : Check Command Execution Capability.
// STATUS.1 : Check Data Read/Write Capability.
// STATUS.2 : Check Auto Mode Data Read Capability.
// STATUS.3 : Check Auto Mode Data Write Capability.
// STATUS.4 : Not Used.
// STATUS.5 : Check Contoller Operation Capability.
// STATUS.6 : Error Flag. Used For Screen Peek and Screen Copy Commands. ( 0:No Error 1:Error )
// STATUS.7 : Check the Blink Condition. ( 0:Display Off 1:Normal Display )
 
byte T6963C_ReadStatus ( void )
{   byte ReturnValue; 
    T6963C_DATADIR = DATADIR_IN;
    T6963C_CD = 1;
    T6963C_CE = 0;
    T6963C_RD = 0;
    #asm ("nop");
    #asm ("nop");
    #asm ("nop");
    #asm ("nop");
    ReturnValue = T6963C_DATAIN;
    T6963C_RD = 1;
    T6963C_CE = 1;
    #asm ("nop");
    #asm ("nop");
    T6963C_DATADIR = DATADIR_OUT;  
    return ReturnValue;
}      

byte T6963C_ReadData ( void )
{   byte ReturnValue; 
    T6963C_DATADIR = DATADIR_IN;
    T6963C_CD = 0;
    T6963C_CE = 0;
    T6963C_RD = 0;
    #asm ("nop");
    #asm ("nop");
    #asm ("nop");
    #asm ("nop");
    ReturnValue = T6963C_DATAIN;
    T6963C_RD = 1;
    T6963C_CE = 1;
    #asm ("nop");
    #asm ("nop");
    T6963C_DATADIR = DATADIR_OUT;
    return ReturnValue;
}      

void T6963C_WriteInstruction ( byte Instruction )
{   T6963C_DATAOUT = Instruction;
    T6963C_CD = 1;
    T6963C_CE = 0;
    T6963C_WR = 0;              
    #asm ("nop");
    #asm ("nop");
    T6963C_WR = 1;
    T6963C_CE = 1;
    #asm ("nop");
    #asm ("nop");
}

void T6963C_WriteData ( byte Data )
{   T6963C_DATAOUT = Data;
    T6963C_CD = 0;
    T6963C_CE = 0;
    T6963C_WR = 0;              
    #asm ("nop");
    #asm ("nop");
    T6963C_WR = 1;
    T6963C_CE = 1;
    #asm ("nop");
    #asm ("nop");
}

void T6963C_WriteCommand0 ( byte Command )
{   while (( T6963C_ReadStatus() & 0x03 ) != 0x03 );           
    T6963C_WriteInstruction ( Command );
}                       

void T6963C_WriteCommand1 ( byte Command, byte Data0 )
{   while (( T6963C_ReadStatus() & 0x03 ) != 0x03 );
    T6963C_WriteData ( Data0 );
    while (( T6963C_ReadStatus() & 0x03 ) != 0x03 );
    T6963C_WriteInstruction ( Command );
}

void T6963C_WriteCommand2 ( byte Command, byte Data0, byte Data1 )
{   while (( T6963C_ReadStatus() & 0x03 ) != 0x03 );
    T6963C_WriteData ( Data0 );
    while (( T6963C_ReadStatus() & 0x03 ) != 0x03 );
    T6963C_WriteData ( Data1 );
    while (( T6963C_ReadStatus() & 0x03 ) != 0x03 );
    T6963C_WriteInstruction ( Command );
}

void T6963C_SetAddress ( word Address )
{   GRAPHIC_ADDRESS.Word = Address;                                         
    T6963C_WriteCommand2 ( T6963C_COMMAND_SetAddressPointer, GRAPHIC_ADDRESS.Byte[0], GRAPHIC_ADDRESS.Byte[1] );
}

void T6963C_SetAddressXY ( word StartX, word StartY )
{   GRAPHIC_ADDRESS.Word = (( StartX >> 0x03 ) + ( GRAPHIC_AREA * StartY ) + GRAPHIC_HOME_ADDRESS.Word );
    T6963C_WriteCommand2 ( T6963C_COMMAND_SetAddressPointer, GRAPHIC_ADDRESS.Byte[0], GRAPHIC_ADDRESS.Byte[1] );
}                              

void T6963C_SetWriteMode ( byte WriteMode )
{   T6963C_WriteCommand0 ( T6963C_COMMAND_WriteMode | WriteMode );
}

void T6963C_Initialize ( void )
{
    T6963C_RST = 0;
    delay_ms (100);
    T6963C_RST = 1;
    delay_ms (10);
                 
    // 8 bit Interval Division 30 x 8 = 240
    T6963C_FS = 0;                        
 
    GRAPHIC_HOME_ADDRESS.Word = T6963C_Graphic_Screen0;  
    T6963C_WriteCommand2 ( T6963C_COMMAND_SetGraphicHomeAddress, GRAPHIC_HOME_ADDRESS.Byte[0], GRAPHIC_HOME_ADDRESS.Byte[1] );
    T6963C_WriteCommand2 ( T6963C_COMMAND_SetGraphicArea, GRAPHIC_AREA, 0x00 );

    TEXT_HOME_ADDRESS.Word  = T6963C_Text_RAM_Area;
    T6963C_WriteCommand2 ( T6963C_COMMAND_SetTextHomeAddress, TEXT_HOME_ADDRESS.Byte[0], TEXT_HOME_ADDRESS.Byte[1] );
    T6963C_WriteCommand2 ( T6963C_COMMAND_SetGraphicArea, TEXT_AREA, 0x00 );

    T6963C_WriteCommand2 ( T6963C_COMMAND_SetOffsetRegister, OFFSET_RESISTER, 0x00 );

    T6963C_SetWriteMode ( WRITE_MODE_EXOR_MODE );
    T6963C_WriteCommand0 ( T6963C_COMMAND_DisplayMode | DISPLAY_MODE_GRAPHIC_ON );


profile
codesign 2014.06.12 21:08
감사합니다. 정말 유용하게 사용하겠습니다.
profile
시나브로69 2016.07.16 17:26

좋은 자료 감사합니다.

profile
와장뽕 2017.12.12 11:26

좋은 자료 감사합니다. ^^

search
List of Articles
번호 분류 제목 평점 포인트 판매자 등록일 구매수 조회 수
공지 공공의 목적으로 공유하고자 하는 소프트웨어는 '소프트웨어 자료실'에 업로드를 요청드립니다.
공지 구매후 평점 댓글을 남겨주시면 구매포인트의 20%를 돌려드립니다.
23 EDA Simulation OrCAD PSpice - 초급자용 [40] 무료 프리미엄 2007-11-04 0 2274
22 EDA Simulation orcad 파라미터 단축키 파일입니다. [10] 무료 웨라러브 2012-03-02 0 2300
21 EDA Simulation PSpice floating 문제 [7] 무료 Interrupter 2011-09-14 0 4364
20 EDA Simulation pspice 입문하시는 분을 위해 [21] 무료 가나초콜릿 2011-02-23 0 3795
19 EDA Simulation 온도에 따른 저항 (써미스터) 시뮬레이션 [6] 무료 ANCAT 2011-02-22 0 4777
18 EDA Simulation pspice에서 질 문 이요 [1] 무료 pigu45 2011-01-31 0 2955
17 EDA Simulation part 질문좀.. [1] 무료 pigu45 2011-01-31 0 2819
16 EDA Simulation 오류 제능력 밖이라서 문의드립니다. [1] 무료 쨍용 2010-12-22 0 3133
15 EDA Simulation 정말 간단한 질문이요..ㅠㅠ [2] 무료 쨍용 2010-11-30 0 2164
14 EDA Simulation pspice 디지털입력 질문이요~ 무료 cadi 2010-11-22 0 2198
13 EDA Simulation layout92 manual [2] 무료 정상까지 가보자! 2010-11-15 0 2329
12 EDA Simulation pspice 자료입니다. [2] 무료 TreeOfDream 2010-09-09 0 3468
11 EDA Simulation pspice 자료 입니다. [9] 무료 TreeOfDream 2010-06-30 0 2483
10 EDA Simulation pspice 라이브러리가이드 메뉴얼입니다. [3] 무료 LAZEX 2010-05-26 0 3349
9 EDA Simulation 전자제도이론.. [6] 무료 양자 2010-01-20 0 2727
8 EDA Simulation OrCAD PSpice 초보자 사용법이에요 [29] 무료 월간낚시 2009-11-30 0 5781
7 EDA Simulation orcad-pspice 메뉴얼 [8] 무료 쫑~ 2009-10-27 0 3179
6 EDA Simulation Orcad Pspice 입출력 설정 [8] 무료 프리미엄 2007-11-04 0 2189
5 EDA Simulation PSpice 사용법 #4 [13] 무료 라이언상병 2007-08-20 0 2117
4 EDA Simulation PSpice 유저가이드 [13] 무료 라이언상병 2007-08-20 0 1968
  • 알차게 보낸 하루가 편안한 잠을 제공하는 것처럼 알찬 생애가 평온한 죽음을 제공한다.
    - 다빈치
  • * 납포인트 정보 *
  • 글 작성 : 3
  • 댓글 작성 : 1
저작권법에 위배되는 콘텐츠는 등록 불가하며, 저작물에 대한 권리는 저작자에게 있습니다.
Copyright 2006-2021 © hardwareis.com, All rights reserved.