회원가입 ID/PW 찾기

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

콘텐츠 수 110
판매자 심야땜쟁이 판매 납포인트 무료 평점 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%를 돌려드립니다.
110 Sensor 설계 바이패스필터에 대한 이야기입니다. [8] 무료 BNT 2015-03-09 0 496
109 Sensor 설계 BEAD에 대한 설명입니다. [20] 무료 BNT 2015-03-09 0 639
108 Sensor 설계 Thyristor Theory and Design Considerations_HAND BOOK [2] 무료 sensor 2015-03-06 0 141
107 Sensor 설계 Turbine Flowmeter 자료 [2] 무료 sensor 2015-02-28 0 140
106 Sensor 설계 저전력 발진IC [4] 무료 sensor 2015-02-28 0 274
105 Sensor 설계 Capacitive & Ultrasonic Sensors Theory of Operation [2] 무료 sensor 2015-02-28 0 94
104 Sensor 설계 Reed Switch의 사용시 주의사항 [5] 무료 sensor 2015-02-23 0 230
103 Sensor 설계 SMD Transistors Marking [5] 무료 sensor 2015-02-23 0 190
102 Sensor 설계 OPAMP해설 LMV321 영문입니다. [5] 무료 Interrupter 2011-09-14 0 2272
101 Sensor 설계 perite-beed 사용법 [4] 무료 놀부 2010-12-28 0 1922
100 Sensor 설계 전기전자기초자료입니다.(네번쨰) [19] 무료 프랭키프랭키 2010-11-18 0 2344
99 Sensor 설계 전기전자기초자료입니다.(세번쨰) [13] 무료 프랭키프랭키 2010-11-18 0 2130
98 Sensor 설계 전기전자기초자료입니다.(두번쨰) [16] 무료 프랭키프랭키 2010-11-18 0 2311
97 Sensor 설계 전기전자 기초자료입니다. [17] 무료 프랭키프랭키 2010-11-18 0 2966
96 Sensor 설계 op-amp 설계 가이드북 입니다. [12] 무료 가오루 2010-08-31 0 3361
95 Sensor 설계 릴레이 기술자료 [7] 무료 가오루 2010-08-31 0 1902
94 Sensor 설계 AXIAL TYPE FUSE [3] 무료 가오루 2010-08-31 0 2320
93 Sensor 설계 Tantalum Chip Capacitor datasheet [3] 무료 가오루 2010-08-31 0 2496
92 Sensor 설계 smd codebook [5] 무료 가오루 2010-08-31 0 2442
91 Sensor 설계 3.3V - 5V Level translation [3] 무료 이화세계를위해 2010-08-30 0 2191
  • 무관심 때문에 사람은 실제로 죽기전에 죽어버린다.
    - 위젤
  • * 납포인트 정보 *
  • 글 작성 : 3
  • 댓글 작성 : 1
저작권법에 위배되는 콘텐츠는 등록 불가하며, 저작물에 대한 권리는 저작자에게 있습니다.
Copyright 2006-2021 © hardwareis.com, All rights reserved.