LM240160GFW yardım

Başlatan gezgin, 29 Mart 2015, 21:30:39

gezgin


    Merhabalar,
   Sitenin yeni üyesiyim,pbp,proton dan sonra arduino ya yeni  başladım.Bir yeden elime LM240160GFW geçti.
  ama tüm aramama ramen sürücü doyasını veya örnek bir uygulama bulamadım...data shetten sürücü dosyası yazacak       becerimde yok c tabanlı lisan bilgim yok arduino ile yeni öğrenmeye başlıyorum....
  Bu GLCD yi tanıyan ,kullanan arkadaşların yardımını rica ederim....

burctankal

MikroC'nin çok kullanışlı bir GLcd kütüphanesi mevcut. isterseniz elinizdeki bitmap resmi kendisi kod haline getiriyor ve size sadece include etmek kalıyor. Aşağıdaki linki incelemenizi tavsiye ederim.

http://320volt.com/mikroc-glcd-bitmap-editor-kullanimi/

gezgin

     
Alıntı yapılan: burctankal - 30 Mart 2015, 11:49:54
MikroC'nin çok kullanışlı bir GLcd kütüphanesi mevcut. isterseniz elinizdeki bitmap resmi kendisi kod haline getiriyor ve size sadece include etmek kalıyor. Aşağıdaki linki incelemenizi tavsiye ederim.

http://320volt.com/mikroc-glcd-bitmap-editor-kullanimi/
Tşk burctankal,
  Bu tür yazılımlar genellikle Ks108 veya  T6963 işlemcili GLCD için yazılmış...LM240260GFW st7529 işlemcisi
kullandığı için amaca uygun değil...ST7529 işlemciyide ihtiva eden bir yazılım aramaktayım...

burctankal

Tamamen internetten bulduğum bir yazılım. ST7528 için olduğunu söylüyor. Umarım işine yarar.


// Modified uGLCD.ST7565R for ST7528 with 8080 parallel interface on 160x100 GLCD

// !!!! This controller has 16 levels of gray scale !!!!

// On-chip display data RAM of 160 x 129 x 4 bits.

// Tested with NHD-C160100AZ-RN-GBW

// http://www.newhavendisplay.com/app_notes/NHD-C160100AZ.txt

// V0_A   27/07/2012

// Changes:

//                             Reason for change

// uGLCD_Init;                 Specific display,parallel interface & gray scale
// uGLCD_Command;              parallel interface
// uGLCD_Write_Data;           parallel interface

// Const: GLCDmaxXc            Display size
// Const: GLCDmaxY             Display size
// Const: GLCDpages            Display size



//***************** uGLCD library optimised for PIC18 processors ************
//             Hardware dependent part for ST7565R based GLCD (with SPI)
//
//       version  0.06
//       date     20.09.2011
//       by janni (text drawing part inspired by X-GLCD lib by octal)
//
//       Revision history:
//                         0.01 - changed lib dependency (mP PRO v 4.0)
//                         0.02 - added uGLCD_Rectangle_Round_Edges,
//                                uGLCD_FillArea, some routines optimised
//                         0.03 - changed font files' format
//                         0.04 - compiled with v4.80 beta
//                         0.05 - compiled with v5.00
//                         0.06 - added Write_TextC & Text_WidthC
//
//***************************************************************************
// uGLCD library allows drawing text and graphics on GLCD screen using
// coordinates x (0..GLCDmaxX) and y (0..GLCDmaxY), where (0,0) corresponds
// to left-top display corner. Hardware dependent part contains hardware
// specific declarations and routines.}
//***************************************************************************


unit uGLCD_ST7528;

uses uGLCDlib;

// ------------------ compiler directives ------------------------------------

// {$Define simula}         // for use with simulator only

// {$Define no_reset}       // no reset (uGLCD_rst) line

// {$Define LTE4MHz}        // oscillator freq <= 4MHz

// {$Define RAMdraw}        // allows drawing on RAM screen

{$Define P18}              // processor is PIC18 family

// ---------------------------------------------------------------------------
// Remember that this unit has to be recompiled after any change to the above!
// ---------------------------------------------------------------------------


// The library requires definitions in main program of following control lines :

//   uGLCD_CS, uGLCD_CD, uGLCD_RST, uGLCD_RD, uGLCD_WR

// See the example below for PIC18 processor.



//********** Glcd module connections - MULTIPLE control lines port *************
//
// This part should be modified to fit hardware
//
// Port E
//
// Data port assignments

var uGLCD_dataPORT : byte at PORTE;  // data port assignments
    uGLCD_dataTRIS : byte at TRISE;
// -----------------------------------------------

// GLCD control lines
const
   uGD_RST = 6; // RF6
   uGD_RD  = 7; // RF7

   uGD_CS  = 0; // RG0
   uGD_CD  = 3; // RG3
   uGD_WR  = 4; // RG4

var
   uGLCD_RST : sbit at LATF.uGD_RST;
   uGLCD_RD  : sbit at LATF.uGD_RD;
   uGLCD_CS  : sbit at LATG.uGD_CS;
   uGLCD_CD  : sbit at LATG.uGD_CD;
   uGLCD_WR  : sbit at LATG.uGD_WR;

   uGLCD_RST_Dir : sbit at TRISF.uGD_RST;
   uGLCD_RD_Dir  : sbit at TRISF.uGD_RD;
   uGLCD_CS_Dir  : sbit at TRISG.uGD_CS;
   uGLCD_CD_Dir  : sbit at TRISG.uGD_CD;
   uGLCD_WR_Dir  : sbit at TRISG.uGD_WR;
//********** End of Glcd module connections ***********************************


(*---------------------------------------------------------------------------
--- User library routines:

procedure uGLCD_Init;
  initializes KS107/8 based GLCD; sets aspect ratio (Y:X) to 1:1

procedure uGLCD_On;
  turns the display on

procedure uGLCD_Off;
  turns the display off

procedure uGLCD_Sleep;
  forces the GLCD into Sleep mode

procedure uGLCD_Wake;
  forces the GLCD into Normal mode

procedure uGLCD_PowerOff;
  should be used before turning supply voltage off

procedure uGLCD_ShiftY(shift:byte);
  shifts display in vertical direction by changing the internal RAM
  initial address (shift=0..63) of GLCD

--- Routines required by main library (uGLCDlib):

procedure uGLCD_SetDataOut;
  used only to ensure that data lines are not left floating

function  uGLCD_Read_Data: byte;
  reads data byte from GLCD

procedure uGLCD_Write_Data(data:byte);
  writes data byte to GLCD

procedure uGLCD_Set_X(x:byte);
  sets the x-coordinate within page and side (x=0..GLCDmaxX)

procedure uGLCD_Set_Page(p:byte);
  sets GLCD 'page' (horizontal line, p=0..GLCDpages)

---------------------------------------------------------------------------*)

const
   // controller limit
   GLCDmaxXc=159;
   
   // GLCD physical limits
   GLCDmaxX=159;
   GLCDmaxY=99;
   {GLCDmaxX=127;               // LCD-AG-C128064CF display
   GLCDmaxY=63;}
   
   {GLCDpages: byte = GLCDmaxY div 8;}
   GLCDpages: byte = 13; // 100 / 8 = 12.5 round up to 13
   
   GLCDsize:  word = (GLCDmaxX+1)*(GLCDpages+1);
   GLCDnwar:  boolean = false; // not Write-After-Read is false
                               // (all reads are done from RAM)


procedure uGLCD_Init;
procedure uGLCD_On;
procedure uGLCD_Off;
procedure uGLCD_Sleep;
procedure uGLCD_Wake;
procedure uGLCD_PowerOff;
procedure uGLCD_ShiftY(shift:byte);
procedure uGLCD_Inverse(inverse:boolean);
procedure uGLCD_Rotate(rotate:boolean);
procedure uGLCD_Contrast(value:byte);
procedure ____internal_ST7565R;
function  uGLCD_Read_Data: byte;
procedure uGLCD_SetDataOut;
procedure uGLCD_Write_Data(datab:byte); // Changed for ST7528
Procedure uGLCD_Fill_1(patt: byte);     // Added for ST7528
procedure uGLCD_set_X(x:byte);
procedure uGLCD_Set_Page(p:byte);
procedure uGLCD_Set_0_0;
//procedure uGLCD_Comm(value:byte);

implementation


var
    uGLCD_CS  : sbit; sfr; external;
    uGLCD_CD  : sbit; sfr; external;
    uGLCD_SDA : sbit; sfr; external;
    uGLCD_SCK : sbit; sfr; external;
    {$IFNDEF no_reset}
    uGLCD_RST : sbit; sfr; external;
    {$ENDIF}

    uGLCD_CS_Dir  : sbit; sfr; external;
    uGLCD_CD_Dir  : sbit; sfr; external;
    uGLCD_SDA_Dir : sbit; sfr; external;
    uGLCD_SCK_Dir : sbit; sfr; external;
    {$IFNDEF no_reset}
    uGLCD_RST_Dir : sbit; sfr; external;
    {$ENDIF}
    rotated: boolean;
   
const
   // initial contrast/brightnees
   GLCDbrtIni=32;
   GLCDvlcdRini=5;
   
   // commands
   GLCDcmdRMWon=$E0;           // Read-Modify-Write, unuseful
   GLCDcmdRMWoff=$EE;          // End Read-Modify-Write, unuseful
   GLCDcmdBooster=$F8;         // Booster Ratio, unused
   GLCDcmdSysRes=$E2;          // reset               OK
   GLCDcmdNOP=$E3;             // NOP                 OK
   GLCDcmdSetPower=$27;        // Power Control display dependant !!!!!
   
   // 2-byte instruction to specify the reference voltage
   GLCDcmdSetEV=$81;           // Electronic volume   OK
   
   GLCDcmdVLCDRR=$20;          // Resistor ratio      OK
   

   // This command has priority over Entire Display On/Off and
   // Reverse Display On/Off.
   GLCDcmdOn=$AF;              // Display On          OK
   GLCDcmdOff=$AE;             // Display Off         OK
   
   GLCDcmdPixOn=$A5;           // Entire Display On   OK
   GLCDcmdPixOff=$A4;          // Entire Display On   OK

   GLCDcmdSleepOn=$AC;         // ??????
   GLCDcmdSleepOff=$AD;        // ??????
   
   GLCDcmdInverse=$A6;         // Inverse off         OK
   GLCDcmdInverseON=$A7;       // Inverse ON  !!!!!
   
   GLCDcmdSegDir=$A0;          // ADC select bit0  - ADC=0: normal direction  !!!!
   
   GLCDcmdComDir=$C0;          // SHL select COM bi-directional selection   !!!!
   GLCDcmdPage=$B0;            // Set page address                            OK
   GLCDcmdColumn=$10;          // Set column address MSB                      OK
   GLCDcmdColumnLSB=$00;       // Set column address LSB

   
   // Set initial display line register
   // 2-byte instruction to specifythe initial display line to realize
   // vertical scrolling
   GLCDcmdRam=$40;             // display start at RAM 0

// procedure uGLCD_SPIinit; forward; -  not used
// procedure uGLCD_SPIsend(buf:byte); forward;  -  not used
procedure uGLCD_Command(cmd:byte); forward; // Changed for ST7528


//
// NHD-C160100AZ-RN-GBW
//
// 160 * 100 parallel 8080
//
// http://www.newhavendisplay.com/app_notes/NHD-C160100AZ.txt
//
Procedure uGLCD_Init;

var gray_level_8 : byte;

begin
   {gray_level_8 := 0x27;}
   gray_level_8 := 0x3C;
   
   // Initialise control lines
   uGLCD_CS := 1;
   uGLCD_CS_Dir := 0;

   uGLCD_CD := 0;
   uGLCD_CD_Dir := 0;

   uGLCD_WR := 1;
   uGLCD_WR_Dir := 0;

   uGLCD_RD := 1;
   uGLCD_RD_Dir := 0;

   // Initialise data port
   uGLCD_dataPORT := 0;
   uGLCD_dataTRIS  := 0;

   uGLCD_RST := 1;
   uGLCD_RST_Dir := 0;
   Delay_ms(20);
   uGLCD_RST := 0;        //*Reset lcd controller*/
   Delay_ms(20);
   uGLCD_RST := 1;
   Delay_ms(200);

   // reset GLCD
   uGLCD_RST := 0;
   uGLCD_RST_Dir := 0;
   Delay_ms(5);
   uGLCD_RST:=1;

   // {$IFDEF no_reset}
   // uGLCD_Command(GLCDcmdSysRes);
   // {$ELSE}
   // Delay_5ms;
   // uGLCD_RST:=1;
   // {$ENDIF}

   uGLCD_Command(0xA2);  // ICON  OFF      %1010 0010
   uGLCD_Command(0xAE);  // Display OFF    %1010 1110

   uGLCD_Command(0x48);  // Set Duty ratio %0100 1000
   uGLCD_Command(0x80);  // No operation   %1000 0000
   uGLCD_Command(0xA0);  // Set scan direction 0=normal/ 1= right to left
   uGLCD_Command(0xC8);  // SHL  select    %1100 1000
   uGLCD_Command(0x40);  // Set START LINE %0100 0000
   uGLCD_Command(0x00);
   uGLCD_Command(0xAB);  // OSC on         %1010 1011

   uGLCD_Command(0x64);  // 3x             %0110 0100
   Delay_ms(20);         // Delay 20ms
   uGLCD_Command(0x65);  // 4x             %0110 0101
   Delay_ms(20);         // Delay 20ms
   uGLCD_Command(0x66);  // 5x             %0110 0110
   Delay_ms(20);         // Delay 20ms
   uGLCD_Command(0x67);  // 6x             %0110 0111
   Delay_ms(20);         // Delay 20ms

   uGLCD_Command(0x27);  // Internal resistance ratio GLCDcmdVLCDRR %0010 0111
   
   //
   // 2-byte instruction to specify the reference voltage
   //
   uGLCD_Command(0x81);  // Set electronic volume register          %1000 0001
   uGLCD_Command(12);    // n=0~3f  GLCDcmdSetEV                    %0000 1100

   uGLCD_Command(0x57);  // 1/12bias
   uGLCD_Command(0x92);  // FRC and pwm

   uGLCD_Command(0x2C);
   Delay_ms(200);        // Delay 200ms
   uGLCD_Command(0x2E);
   Delay_ms(200);        // Delay 200ms
   uGLCD_Command(0x2F);
   Delay_ms(200);        // Delay 200ms

   uGLCD_Command(0x92);  // frc and pwm
   uGLCD_Command(0x38);  // external  mode
   uGLCD_Command(0x75);

   //
   //start settings for 16-level grayscale
   //
   uGLCD_Command(0x97);  // 3frc,45pwm

   uGLCD_Command(0x80);  // Set white mode and 1st frame
   uGLCD_Command(0x00);  // set pulse width
   
   uGLCD_Command(0x81);  // Set white mode and 2nd frame
   uGLCD_Command(0x00);  // set pulse width

   uGLCD_Command(0x82);  // Set white mode and 3rd frame
   uGLCD_Command(0x00);  // set pulse width

   uGLCD_Command(0x83);  // Set white mode and 4th frame
   uGLCD_Command(0x00);  // set pulse width

   // Set gray level 1 mode (4 bytes)
   uGLCD_Command(0x84);
   uGLCD_Command(0x06);
   uGLCD_Command(0x85);
   uGLCD_Command(0x06);
   uGLCD_Command(0x86);
   uGLCD_Command(0x06);
   uGLCD_Command(0x87);
   uGLCD_Command(0x06);

   // Set gray level 2 mode (4 bytes)
   uGLCD_Command(0x88);
   uGLCD_Command(0x0B);
   uGLCD_Command(0x89);
   uGLCD_Command(0x0B);
   uGLCD_Command(0x8A);
   uGLCD_Command(0x0B);
   uGLCD_Command(0x8B);
   uGLCD_Command(0x0B);

   // Set gray level 3 mode (4 bytes)
   uGLCD_Command(0x8C);
   uGLCD_Command(0x10);
   uGLCD_Command(0x8D);
   uGLCD_Command(0x10);
   uGLCD_Command(0x8E);
   uGLCD_Command(0x10);
   uGLCD_Command(0x8F);
   uGLCD_Command(0x10);

   // Set gray level 4 mode (4 bytes)
   uGLCD_Command(0x90);
   uGLCD_Command(0x15);
   uGLCD_Command(0x91);
   uGLCD_Command(0x15);
   uGLCD_Command(0x92);
   uGLCD_Command(0x15);
   uGLCD_Command(0x93);
   uGLCD_Command(0x15);

   // Set gray level 5 mode (4 bytes)
   uGLCD_Command(0x94);
   uGLCD_Command(0x1A);
   uGLCD_Command(0x95);
   uGLCD_Command(0x1A);
   uGLCD_Command(0x96);
   uGLCD_Command(0x1A);
   uGLCD_Command(0x97);
   uGLCD_Command(0x1A);

   // Set gray level 6 mode (4 bytes)
   uGLCD_Command(0x98);
   uGLCD_Command(0x1E);
   uGLCD_Command(0x99);
   uGLCD_Command(0x1E);
   uGLCD_Command(0x9A);
   uGLCD_Command(0x1E);
   uGLCD_Command(0x9b);
   uGLCD_Command(0x1E);

   // Set gray level 7 mode (4 bytes)
   uGLCD_Command(0x9C);
   uGLCD_Command(0x23);
   uGLCD_Command(0x9D);
   uGLCD_Command(0x23);
   uGLCD_Command(0x9E);
   uGLCD_Command(0x23);
   uGLCD_Command(0x9F);
   uGLCD_Command(0x23);

   // Set gray level 8 mode (4 bytes)
   uGLCD_Command(0xA0);
   uGLCD_Command(gray_level_8);
   uGLCD_Command(0xA1);
   uGLCD_Command(gray_level_8);
   uGLCD_Command(0xA2);
   uGLCD_Command(gray_level_8);
   uGLCD_Command(0xA3);
   uGLCD_Command(gray_level_8);

   // Set gray level 9 mode (4 bytes)
   uGLCD_Command(0xA4);
   uGLCD_Command(0x2B);
   uGLCD_Command(0xA5);
   uGLCD_Command(0x2B);
   uGLCD_Command(0xA6);
   uGLCD_Command(0x2B);
   uGLCD_Command(0xA7);
   uGLCD_Command(0x2B);

   // Set gray level 10 mode (4 bytes)
   uGLCD_Command(0xA8);
   uGLCD_Command(0x2F);
   uGLCD_Command(0xA9);
   uGLCD_Command(0x2F);
   uGLCD_Command(0xAA);
   uGLCD_Command(0x2F);
   uGLCD_Command(0xAB);
   uGLCD_Command(0x2F);

   // Set gray level 11 mode (4 bytes)
   uGLCD_Command(0xAC);
   uGLCD_Command(0x32);
   uGLCD_Command(0xAd);
   uGLCD_Command(0x32);
   uGLCD_Command(0xAE);
   uGLCD_Command(0x32);
   uGLCD_Command(0xAF);
   uGLCD_Command(0x32);

   // Set gray level 12 mode (4 bytes)
   uGLCD_Command(0xB0);
   uGLCD_Command(0x35);
   uGLCD_Command(0xB1);
   uGLCD_Command(0x35);
   uGLCD_Command(0xB2);
   uGLCD_Command(0x35);
   uGLCD_Command(0xB3);
   uGLCD_Command(0x35);

   // Set gray level 13 mode (4 bytes)
   uGLCD_Command(0xB4);
   uGLCD_Command(0x38);
   uGLCD_Command(0xB5);
   uGLCD_Command(0x38);
   uGLCD_Command(0xB6);
   uGLCD_Command(0x38);
   uGLCD_Command(0xB7);
   uGLCD_Command(0x38);

   // Set gray level 14 mode (4 bytes)
   uGLCD_Command(0xB8);
   uGLCD_Command(0x3A);
   uGLCD_Command(0xB9);
   uGLCD_Command(0x3A);
   uGLCD_Command(0xBA);
   uGLCD_Command(0x3A);
   uGLCD_Command(0xBB);
   uGLCD_Command(0x3A);

   uGLCD_Command(0xBC);  // Set Dark mode and 1st frame
   uGLCD_Command(0x3C);  // set pulse width
   uGLCD_Command(0xBd);  // Set Dark mode and 2nd frame
   uGLCD_Command(0x3C);  // set pulse width
   uGLCD_Command(0xBE);  // Set Dark mode and 3rd frame
   uGLCD_Command(0x3C);  // set pulse width
   uGLCD_Command(0xBF);  // Set Dark mode and 4th frame
   uGLCD_Command(0x3C);  // set pulse width
   //end settings for 16-level grayscale

   uGLCD_Command(0x38);  //              %0011 1000
   uGLCD_Command(0x74);  //              %0111 0100
   uGLCD_Command(0xAF);  //Display ON    %1010 1111
end; // uGLCD_Init


procedure uGLCD_On;
begin
  uGLCD_Command(GLCDcmdOn);    // uGLCD_Command(0xaf);     //Display ON
End;{uGLCD_On}


procedure uGLCD_Off;
begin
  uGLCD_Command(GLCDcmdOff);
End;{uGLCD_On}


procedure uGLCD_Sleep;
begin
  uGLCD_Command(GLCDcmdSleepOn);
  uGLCD_Command(0);
  uGLCD_Command(GLCDcmdOff);
  uGLCD_Command(GLCDcmdPixOn);
End;{uGLCD_Sleep}


procedure uGLCD_Wake;
begin
  uGLCD_Command(GLCDcmdSleepOff);
  uGLCD_Command(0);
  uGLCD_Command(GLCDcmdPixOff);
  uGLCD_Command(GLCDcmdOn);
End;{uGLCD_Wake}


procedure uGLCD_PowerOff;
begin
  uGLCD_Sleep;
  {$IFDEF no_reset}
   uGLCD_Command(GLCDcmdSysRes);
  {$ELSE}
   uGLCD_RST:=0;
  {$ENDIF}
  Delay_10ms;
  Delay_10ms;
End;{uGLCD_PowerOff}


procedure uGLCD_ShiftY(shift:byte);
begin
  shift:=shift and $3F;
  uGLCD_Command(GLCDcmdRam or shift);
End;{uGLCD_ShiftY}


procedure uGLCD_Inverse(inverse:boolean);
begin
  inverse:=inverse and $01;
  uGLCD_Command(GLCDcmdInverse or inverse);
End;{uGLCD_Inverse}


procedure uGLCD_Rotate(rotate:boolean);
begin
  rotated:=rotate;
  if rotate then
   begin
    uGLCD_Command(GLCDcmdSegDir);
    uGLCD_Command(GLCDcmdComDir or 8);
   end
  else
   begin
    uGLCD_Command(GLCDcmdSegDir or 1);
    uGLCD_Command(GLCDcmdComDir);
   end;
End;{uGLCD_Rotate}


procedure uGLCD_Contrast(value:byte);
begin
  value:=value and $3F;
  uGLCD_Command(GLCDcmdSetEV);
  uGLCD_Command(value);
End;{uGLCD_Contrast}


//----- Routines for internal use

procedure ____internal_ST7565R;
begin end;

// procedure uGLCD_SPIinit; - deleted as not used

// procedure uGLCD_SPIsend(buf:byte); - deleted as not used

function uGLCD_Read_Data: byte;
begin
  {$IFDEF RAMdraw}
   if uGLCD_RAMdraw then
    begin
     {$IFNDEF P18}
      result:=uGLCD_RAMbyte_addr^;
     {$ELSE}
      uGLCD_RAMbyte_addr;
      result:=INDF0;
     {$ENDIF}
    end;
  {$ELSE}
   result:=0;
  {$ENDIF}
End;{uGLCD_Read_Data}


// Required by uGLCDlib unit
procedure uGLCD_SetDataOut;
begin
End;{uGLCD_SetDataOut}

Procedure uGLCD_Write_Data(datab : byte);
{$IFNDEF P18}
var ptrb : ^byte;
{$ENDIF}
begin
  {$IFDEF RAMdraw}
   if uGLCD_RAMdraw then
      begin
         {$IFNDEF P18}
             ptrb  := uGLCD_RAMbyte_addr;
             ptrb^ := datab;
         {$ELSE}
             uGLCD_RAMbyte_addr;
             INDF0 := datab;
         {$ENDIF}
         inc(uGLCDposX);
         exit;
      end;
  {$ENDIF}

   uGLCD_CD := 1;         // Data register
   uGLCD_RD := 1;         // Read inactive
   uGLCD_dataPORT := datab;
   uGLCD_CS := 0;
   uGLCD_WR := 0;
   uGLCD_WR := 1;
   uGLCD_CS := 1;
end; // End uGLCD_Write_Data


Procedure uGLCD_Command(cmd : byte);
begin
   uGLCD_CD := 0;         // Command register
   uGLCD_RD := 1;         // Read inactive
   uGLCD_dataPORT := cmd;
   uGLCD_CS := 0;
   uGLCD_WR := 0;
   uGLCD_WR := 1;
   uGLCD_CS := 1;
end; // End uGLCD_Command


Procedure uGLCD_Fill_1(patt: byte);

var Page_num, i, j : byte;

begin
   Page_num := GLCDcmdPage;
   i := 0;
   while i < GLCDpages do
      begin

         uGLCD_Command(Page_num);   // Set page address
         uGLCD_Command(GLCDcmdColumn);    // Set column address MSB
         uGLCD_Command(GLCDcmdColumnLSB); // Set column address LSB

         j := 0;
         while j < GLCDmaxX do // each page has 'GLCDmaxX' pixel columns
            begin
               //16 level grayscale; write each byte 4 times
               uGLCD_Write_Data(patt);
               uGLCD_Write_Data(patt);
               uGLCD_Write_Data(patt);
               uGLCD_Write_Data(patt);
               j := j + 1;
            end;
         
         i := i + 1;
         Page_num := Page_num + 1;
      end;
end; // End Fill_1


procedure uGLCD_Comm(value:byte);
begin
  uGLCD_Command(value);
End;{uGLCD_Comm}


procedure uGLCD_Set_Page(p:byte);
begin
  p:=p and $0F;
  {$IFDEF RAMdraw}
   if uGLCD_RAMdraw then
    begin
     uGLCDpage:=p;
     exit;
    end;
  {$ENDIF}
  p:=p or GLCDcmdPage;
  uGLCD_Command(p);
End;{uGLCD_Set_Page}


procedure uGLCD_set_X(x:byte);
begin
  {$IFDEF RAMdraw}
   if uGLCD_RAMdraw then
    begin
     uGLCDposX:=x;
     exit;
    end;
  {$ENDIF}
  if rotated then
   x:=x+(GLCDmaxXc-GLCDmaxX);
  uGLCD_Command(x and $0F);
  x:=swap(x and $F0);
  x:=x or GLCDcmdColumn;
  uGLCD_Command(x);
End;{uGLCD_set_X}


Procedure uGLCD_Set_0_0;
begin
   uGLCD_Command(GLCDcmdPage);     // Set page address
   uGLCD_Command(GLCDcmdColumn);    // Set column address MSB
   uGLCD_Command(GLCDcmdColumnLSB); // Set column address LSB
end; // End uGLCD_Set_0_0


END.

gezgin

      Yaramadı,bu hınzır LM240160 kontras ayarını,çalışma frekansını,gri tonlamayı yazılım ile yapıyor..
     8x5 cm mavi ekran çok şık bir şey ama yazılım olmayınca   galiba zamana yayacağım.....

Powered by EzPortal