Sonsivri

Electronics => Pic C Languages => Topic started by: saint on March 27, 2009, 11:47:48 11:47



Title: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: saint on March 27, 2009, 11:47:48 11:47
Hi Everyone,

Several days ago i started a commercial project which uses a 128x64 KS108 based GLCD. I started to write some code for make the GLCD alive by using "GLCD.c" driver which comes with CCS. (This is the first time that I'm using 128x64 GLCD :-\ ). It worked great on my hardware without any problems but original driver file had really limited ready to use functions in it.  :-\

So I decided to add some new functions and make a new library for my project. After a sleepless night + 4 mug of coffee, I've added 5 new functions and I wanted to share it with you...

I hope this new Library also helps you on your projects...Feel free to use it  ;D

Here are the functions added by me:

============================================================

  • glcd_standby(command)

                     Turns ON-OFF graphic LCD. Good solution on system standby
                     GLCD does not clear its memory map on OFF command. So last
                     screen shows up when ON command send to GLCD

  • glcd_3Dbox(x,y,width,height,depth,color)

                     Draws a 3D box on a graphic LCD (Ex: to make a 3D Button)

  • glcd_circle_seg(x,y,radius,angle_start,angle_end,color)

                     Draws a segment of a circle on a graphic LCD

  • glcd_image(inverse)

                     Fills the graphic LCD screen with 128x64 bit converted image
                     with inverse option

  • glcd_image_xy(x,y,inverse)
                   
                     Draws less or equal 128x64 pixels of image to the graphic LCD
                     screen on specified x, y coordinate with inverse option

============================================================

You can find detailed descriptions and "How To Use" information's above the related functions...

I'm also adding a Test Program which demonstrates each function on GLCD. Hardware based on 18F4520 with 10Mhz Xtal (HW enabled 4X PLL - H4 fuse used).
You can see my PIN connections at the pin definition section in my "Extended_GCD.c" library. You also can use your own connections...

Have a nice programming days...

SAINT


! Info: I used "Bitmap2LCD BASIC Edition V1.5b" to convert the images. Basic version of this program is free at http://bitmap2lcd.com

When you select the Bitmap or JPEG image in the program, choose "Table vertical downwards" and "Most significant bit last" from "File & Encoder Manager" toolbar at the right of your screen...

! RAR File Edited: Related BMP images added to the RAR archive...


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: dilipvpn on August 26, 2009, 08:05:30 08:05
Sir,
How i can use more than one images like image[],image2[].etc


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: kemalserkan on April 05, 2010, 07:08:53 19:08
i changed glcd_image_xy function. you can add more image arrarys. you must use #ROM adress={list} for image arrays.
(Note: i can't use pointers because my ccs c compiler doesn't workwith pointers(4.104 version)-does anyone have similar mistake with this version of compiler??)

Posted on: April 05, 2010, 08:07:07 20:07 - Automerged

or you can use this
void glcd_image(long mempointer)
{  int j, i;
   int page = 0xB8;
   char chipsel;
   char buffer[1];
   output_low(GLCD_DI);                // Set for instruction
   glcd_writeByte(GLCD_CS1, 0x40);     // Set the column address to 0
   glcd_writeByte(GLCD_CS2, 0x40);
   glcd_writeByte(GLCD_CS1, page);     // Set the page address to 0
   glcd_writeByte(GLCD_CS2, page);
   for (j = 0; j < 8; j++, page+=1)
   {  output_low(GLCD_DI);
      glcd_writeByte(GLCD_CS1, page);
      glcd_writeByte(GLCD_CS2, page);
      for (i = 0; i < 128; i++)
      {
         if ( i < 64)
         {
            chipsel = GLCD_CS1;
         }
         else
         {
            chipsel = GLCD_CS2;
         }
         read_program_memory(mempointer, buffer, 1);
         mempointer++;
         output_high(GLCD_DI);
         glcd_writeByte(chipsel, *buffer);
      }
   }
}


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: metal on April 10, 2010, 10:45:24 22:45
Any one tried to add the functionality to use with glcd font creator?


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: th_sak on November 23, 2011, 02:30:00 14:30
I'm trying to download this lib but I get a corrupted rar file. Does anyone have it to reupload?

Thank's


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: PCROBOTICS on November 23, 2011, 06:34:24 18:34
I'm trying to download this lib but I get a corrupted rar file. Does anyone have it to reupload?

Thank's

Yes, I download the file and I could not open it. Please if anyone has it, upload it, thanks.


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: jack12345 on November 24, 2011, 02:11:15 14:11
new download  link
http://www.4shared.com/file/5j0q4pGV/Extended_GLCD.html


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: saint on December 09, 2011, 12:42:05 12:42
New Download link added to topic...


Title: Re: Extended GLCD Library for CCS (128x64 - KS0108 Based LCDs)
Post by: ahmed on April 26, 2015, 10:21:15 10:21
Hi,

Here is Modified version of CCS built in GLCD library for KS0108 based GLCD.(HDM64GS12.c and Graphics.c)

With some new and modified functions from Extended GLCD Library (posted here some years ago) and other by me.

New Functions included in library are,


    glcd_3Dbox(x,y,width,height,depth,color)


                     Draws a 3D box on a graphic LCD (Ex: to make a 3D Button)

    glcd_circle_seg(x,y,radius,angle_start,angle_end,color)


                     Draws a segment of a circle on a graphic LCD

    glcd_image(inverse)


                     Fills the graphic LCD screen with 128x64 bit converted image
                     with inverse option

    glcd_image_xy(x,y,inverse)

                  
                     Draws less or equal 128x64 pixels of image to the graphic LCD
                     screen on specified x, y coordinate with inverse option

    glcd_putc1116(x,y,textptr,size,color)                                              
                    * Write Text in 11x16 font



Tested personally! On software and by hardware both.
Demo Project of CCS compiler and Library files are attached.Proteus file is also included