GLCD Yardım

Başlatan thenorthstar, 04 Mayıs 2012, 16:18:50

thenorthstar

Merhaba arkadaşlar;
Bende Aşağıdaki kodu bulunan GLCD den var fakat bir türlü ccs de kütüphanesini bulamadım bu konuda yardımcı olabilirmisiniz acaba, GLCD yi çalıştırabileceğim bir kütüphane dosyası varmı?  Teşekkür ederim.
http://www.believe.it/2/p.asp?p=RYcsMBJn9XuAVE0
YMS12864-15CFCBDGL
LCD STN 128x64 NEG COG W/LED NT 6" 93X53mm

Burak B

CCS kodunu kendin yazacaksın hazır yok. Elinde herşey mevcut. Bak LCD' nin datasheet'i de varmış elinde. Al benden de ek bilgi. Bağlantı arayüz şekli 6800 müş. Ona göre Datasheetindeki diagrama dikkat et. Kontrolcü datasheetini oku. Komutlar belli. Bulamazsın diye booster için gerekli kondansatör bağlantısını içeren örnek lcd datasheetinide veriyorum.

Kontrolcü Datasheeti
Kondansatör Değerleri ve Bağlantısı için 12. Sayfaya bak.

Al daha da kolaylık sağlayayım. 8051 için kod da vereyim hemde 6800 interface.
NT7538 6800

Kolay gelsin.
"... a healthy dose of paranoia leads to better systems." Jack Ganssle

thenorthstar

Hocam uğraştım ama olmadı yapamadım :( 
Verdiğin bilgiler için teşekkür ederim.

Burak B

Yazdığın koda bakayım. Ne kadar uğraştın nerde hata yaptın görelim. :)
"... a healthy dose of paranoia leads to better systems." Jack Ganssle

thenorthstar

Merhaba Hocam;
Dosya yı linkten indirebilirsiniz hocam,
sağdan soldan birşeyler yapmaya çalıştım ama nekadar doğru oldu bilmiyorum. Datasheet okumada pek iyi değilim :(
http://www.4shared.com/rar/7TYj80u6/GLCD1.html

Burak B

4shared üyelik v.s. istiyor. Düzgün biryere upload et. Hatta gerek yok buraya bile yazabilirsin.
"... a healthy dose of paranoia leads to better systems." Jack Ganssle

thenorthstar

Ekledim Hocam.

Main.c
#include "Main.h"

void lcd_write(int8 rs,int8 data)
{
   //LCD_CS=0;
   output_low(LCD_CS);
      if(rs==0)          
         output_low(LCD_RS);
      else
       output_high(LCD_RS);
       output_low(LCD_RW);           
       output_d(data);  //LCD_DAT_BUS=data;  //write data
       output_high(LCD_EN);  //  LCD_EN=1;   //CLK=1
       delay_ms(10);        
       output_low(LCD_EN);    
       output_high(LCD_CS);   // LCD_CS=1;
       
}  
//============================================
void lcd_init(void)
{ 
 output_low(LCD_RST);
 delay_ms(10);
 output_high(LCD_RST);
 delay_ms(10);
 
   lcd_write(0,0xe2);  
   delay_us(1); 
   lcd_write(0,0xa1);   //segment drive is normal ADC=0;0xa1 is Reverse 
   lcd_write(0,0x40);   //Initial display line for COM0
   lcd_write(0,0xc0);   //Com drive is normal;0xc8 is Reverse
  delay_us(1); 
   lcd_write(0,0xa2);   //Bias 1/9
   lcd_write(0,0x2c);   //Voltage Converter ON 
   lcd_write(0,0x2e);   //Voltage Regulator ON 
    lcd_write(0,0x2f);    //Voltage Follower ON
   delay_us(1); 
   lcd_write(0,0x27);
   delay_us(1); 
   lcd_write(0,0x81);
   lcd_write(0,0x05);
   lcd_write(0,0xaf); 
delay_ms(1); 
}

void lcd_clear(int8 dat)
{   
    int8 i,j;
    for(i = 0xb0;i<0xb8;i++)
    { 
        lcd_write(0,i); 
        lcd_write(0,0x0a); 
        lcd_write(0,0x00);
        for(j = 0x00;j<0x41;j++)
        {   lcd_write(1,dat); 
            lcd_write(1,dat);            
        }
    }
}

void lcd_disp_update(void)
{
int8 i,j;
int8 tmp=0;
    for(i = 0xb0;i<0xb8;i++)
    { 
        lcd_write(0,i);
        lcd_write(0,0x0a);
        lcd_write(0,0x00);
        for(j = 0x00;j<0x41;j++)
        {   lcd_write(1,sungerbob[tmp]);
            ++tmp;
            lcd_write(1,sungerbob[tmp]);  
            ++tmp;         
        }
    }
}


void main()
{
   set_tris_a(0xff);
   set_tris_b(0x01);
   set_tris_c(0x00);
   set_tris_d(0x00);
   port_b_pullups(0xff);
   output_high(PIN_B6);
   lcd_init();
   lcd_clear(0x00);
   while(1);
   lcd_disp_update();
}


Main.h
#include "18F452.h"
#device adc=10
#fuses  XT
#fuses NOWDT             
#fuses PUT 

#fuses NOBROWNOUT 
#use fast_io(A)
#use fast_io(C)
#use fast_io(b)
#use fast_io(d)
#use delay(clock=4000000)
#byte LCD_Data = 0xf83 // Data portunun işlemcideki adresi (18f452 için D port adresi 0xf83) 

#define  LCD_EN      PIN_B4   
#define  LCD_RW      PIN_B3  
#define  LCD_RS      PIN_B2  
#define  LCD_RST     PIN_B1  
#define  LCD_CS      PIN_B5   


//========================================================
const int8 sungerbob[]=
{//  128*64
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0x40,0xC0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
       0x00,0x00,0x80,0xC0,0x60,0x20,0x30,0x10,0x18,0x08,0x0C,0x04,0xE6,0xF2,0x33,0x31,0x18,0x98,0xF0,0x01,0x0F,0x08,0x10,0x10,0xF0,0x80,0x00,0x00,0x04,0x1F,0x31,0x21,0x21,0x23,0x22,0x32,0x1E,0x8E,0xC0,0xE0,0x20,0x3C,0x18,0x08,0x08,0x08,0x08,0x08,0x0C,0x0C,0x84,0xC4,0xCC,0xC8,0xCC,0xCC,0x9C,0x90,0x30,0x20,0x40,0x80,0x00,0xC0,0x60,0x34,0x9C,0x8C,0xC4,0xC4,0xC4,0xC4,0x8C,0x8C,0x04,0x0C,0x08,0x08,0x18,0x18,0x0C,0x38,0x20,0xC0,0x00,0x00,0x7C,0xC4,0xC6,0x64,0x3C,0x00,0x1C,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0x40,0x60,0xA0,0xE0,0xA0,0x60,0x00,0x00,0x00,0x00
       0x00,0x00,0x00,0x03,0x02,0x06,0x1C,0x38,0x30,0xE0,0xC0,0x80,0x07,0x1C,0x30,0x20,0x30,0x1F,0xE0,0xF8,0x1C,0x88,0xF8,0x50,0x03,0x0F,0x38,0xE0,0x80,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x13,0x0F,0x0C,0x08,0x18,0x10,0xD0,0x90,0x90,0x18,0x10,0x30,0x33,0x23,0x27,0x27,0x2F,0x3F,0x17,0x17,0x13,0x13,0x18,0x0C,0x0F,0x00,0x07,0x0C,0x3B,0x37,0x77,0xDF,0x9F,0x9F,0x8F,0x8F,0x8F,0x03,0x00,0x80,0x80,0xC0,0x60,0x60,0x20,0x20,0x3F,0x30,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x78,0xCC,0x86,0x02,0x02,0x82,0x96,0xBB,0x8B,0x8D,0x96,0xDF,0x6D,0x29,0x38,0x00,0x00,0x00,0x00,0x00,0x00
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x02,0x0E,0x1C,0x70,0xE0,0x83,0x0E,0x0F,0x89,0xF0,0x90,0x88,0x8C,0x8B,0xF8,0x07,0x3C,0x60,0xC0,0x0F,0x09,0xC8,0x6D,0x27,0x20,0x20,0x20,0xE0,0x00,0x00,0x3F,0x7F,0xFF,0xBF,0xBF,0x3F,0x3F,0x3E,0x3E,0x7E,0x7E,0x7E,0x7E,0x70,0x70,0x70,0x70,0x70,0xF8,0xFE,0xFE,0xFE,0xFE,0x1A,0x00,0x00,0x00,0x01,0x01,0x03,0x01,0x03,0x01,0x01,0x00,0xC0,0x60,0x38,0x04,0x06,0x02,0xE2,0x32,0x16,0x1C,0x18,0xC0,0x60,0x3F,0x20,0x20,0x20,0xE0,0x20,0x60,0x60,0x60,0xE0,0xA0,0xB0,0xB0,0x98,0xCE,0x67,0x63,0x39,0x0D,0x04,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x1E,0x13,0x71,0xE1,0xA1,0x23,0xE2,0xE7,0x4F,0xF8,0xC9,0x81,0x80,0x80,0x80,0x80,0x83,0xFE,0xF0,0xF1,0x13,0x16,0x14,0x14,0x16,0x13,0x13,0x10,0x10,0x10,0x10,0x12,0x11,0x11,0x11,0x11,0x99,0x99,0x99,0x91,0x91,0x91,0x91,0x91,0x71,0x35,0x15,0x15,0x71,0xD0,0x90,0x90,0x90,0x98,0x98,0x90,0x90,0x10,0x10,0x10,0x90,0x90,0x90,0x91,0x91,0x99,0x89,0x89,0x89,0x09,0x08,0xF8,0x18,0x0C,0x0F,0x0C,0x06,0x02,0x02,0x02,0x03,0x02,0x03,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x88,0x07,0x80,0x00,0xC3,0xC4,0x04,0x9C,0xEC,0x08,0x08,0x09,0x39,0x68,0x48,0x49,0x49,0xC8,0x48,0x49,0xC9,0xC9,0xC9,0xC9,0xC9,0x49,0x69,0x29,0x18,0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x0E,0x1E,0x18,0x0E,0x0A,0xEB,0x09,0x09,0xE9,0x09,0x09,0x09,0x08,0x08,0x08,0x18,0x09,0x09,0x09,0x09,0x09,0x09,0x08,0x08,0x08,0x08,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xE0,0xFF,0xC0,0xC0,0xFF,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xE0,0xF0,0xFF,0xE0,0xEE,0xE3,0xE0,0xC0,0xC0,0xC0,0xC0,0x40,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
   

};
//============================================================================



GLCD Bağlantısı:


Yükleme Yapılan Resim: