Page 1 of 1

LIBRARY for NOKIA 6100 COLOUR LCD 132x132 pixels

Posted: 26 Apr 2007 09:20
by yo2lio
NOKIA 6100 COLOUR LCD LIBRARY 132x132 pixels

Author MEDREA FLORIN ANDREI, thanks to ANTON RIECKERT.

Implemented on EasyPIC4 board, MCU PIC18F4620, Clock 40 MHz (10x4).
LCD SUPORT UP TO 65535 COLOURS. Now software is only for 256 colours !

PINOUTS : http://thomaspfeifer.net/nokia_6100_display.htm

LCD is connected on PORTB,0,1,2,3. Attention ! LCD work on 3.3 V. See SDCARD connections to MCU from MP help for more informations !!!
RESET : RB0 - LCD pin 2;
SDATA : RB1 - LCD pin 3;
SCLK : RB2 - LCD pin 4;
CS : RB3 - LCD pin 5;
LCD pin 1 + 6 : VCC 3.3 V
LCD pin 8 + 9 : GND
LCD pin 10 : Backlight through 470 ohm resistor to + 12V

Code: Select all

procedure LCD_PH_TYPE(const tip : byte); // tip : LCD_A or LCD_B
	example : LCD_PH_TYPE(LCD_A); 
procedure LCD_PH_Init;
	example : LCD_PH_Init;
procedure LCD_PH_Direction(direction : byte); // VERTICAL OR HORIZONTAL
	example : LCD_PH_Direction(VERTICAL); 
procedure LCD_PH_Background(colour : byte);
procedure LCD_PH_Text_Background(colour : byte);
procedure LCD_PH_Text_Color(colour : byte); // colour : WHITE, BLACK, RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA	
	example : LCD_PH_Background(WHITE);
   example : LCD_PH_Text_Background(WHITE);
   example : LCD_PH_Text_Color(BLACK);	
procedure LCD_PH_Text_Size(size : byte); // size 1 to 16;
	example : LCD_PH_Text_Size(2);
procedure LCD_PH_Clear_Screen;
	example : LCD_PH_Clear_Screen;
procedure LCD_PH_Set_XY(x1,y1,x2,y2: byte);
	example : LCD_PH_Set_XY(0,0,131,131);
procedure LCD_PH_Put_Text(xx,yy : byte; var txt : array[22] of char);
	example : LCD_PH_Put_Text(6,26,'NOKIA 6100');
procedure LCD_PH_Put_Text_CP(var txt : array[22] of char);
	example : LCD_PH_Put_Text_CP('NOKIA 6100');
procedure LCD_PH_Rectangle(x1,y1,x2,y2 : byte; bgcolor : byte);
	example : LCD_PH_Rectangle(0,0,131,131,GREEN);
procedure LCD_PH_Chr (x,y,kar : byte);
	example : LCD_PH_Chr (10,10,'B');
procedure LCD_PH_Chr_CP(kar : byte);
	example : LCD_PH_Chr_CP('B');
procedure Draw_RGB;
	example : Draw_RGB;
procedure Draw_RYB;
	example : Draw_RYB;
procedure Put_Image(address,lungime : longint); // put image on the screen 132x132 pixels 256 colours
	example : Put_Image(@WIN_XP_BMP,17424);
You can download full source code from here: http://www.microelemente.ro/MikroPascal ... 100_PH.zip

For Put_Image procedure you have a NokiaLcdEditor program.

Best regards Florin Medrea.

Posted: 10 May 2007 06:19
by joseLB
Florin
I got your nokia library and prepared it to use MakroIt, just as an example to make it generic about registers and about screen size.
(to know about MakroIt, please, take a look at http://www.mikroe.com/forum/viewtopic.php?t=9919 )

Regards Jose

Posted: 10 May 2007 07:10
by yo2lio
Hi JoselB,

Thanks a lot !

Very nice job ! I have tested the program at my home and not working because from various reasons I used WINME like operation system.
Now I am at work on WINXP and you program work very good.
On WINME I can't open files.

Best regards, Florin Medrea.

Posted: 10 May 2007 14:04
by Donald Shimoda
yo2lio wrote:Hi JoselB,

Thanks a lot !

Very nice job ! I have tested the program at my home and not working because from various reasons I used WINME like operation system.
On WINME I can't open files.
have a lot of sense because WINME is a Virus. Is the poor OS never writed. I think youmust avoid that one, better install Windows 98 SE.

Best regards.

Posted: 10 May 2007 19:41
by joseLB
yo2lio wrote:Hi JoselB,
Thanks a lot !
Very nice job ! I have tested the program at my home and not working because from various reasons I used WINME like operation system.
Now I am at work on WINXP and you program work very good.
On WINME I can't open files.
Best regards, Florin Medrea.
Hi, Florin, yes, I just confirmed that AutoIt (the language) don't open pulldown menus in some instances of ME (maybe all). Good to know that you liked it.

Posted: 11 May 2007 08:57
by yo2lio
Hi JoselB,

I want to make a remark :

If you change a program writed by other users, please be careful to do not introduce errors in their programs.

I take a look over My NOKIA 6100 COLOUR LCD LIBRARY 132x132 pixels and i found some mistakes in source modified by MakroIt program.

If you change a parameter be sure that you change it correctly in all locations. Otherwise correct program tested by author will be a program with errors.

You made a good work, but if you want make a change in program , first you must understand the program.

I work many many hours in programing, I try to not make mistakes in the programs and so that is posible to apare some mistakes.

All programs posts by me, are tested before I put them on the forum.

OK, If you want :

1. Please change XY max size from 130x130 to 132x132, make your program to subsract 1 from this values and put them on X_MAX, Y_MAX

from code :

Code: Select all

     X_MAX      : byte = 130; must be 131
     Y_MAX      : byte = 130; must be 131
2. This values are used in many functions and procedures , please make the correct changes everywhere :

Code: Select all

Procedure LCD_PH_Clear_Screen;
var k : word;
Begin
  LCD_PH_Set_XY(0,0,131,131); < this
  For k := 0 to 17423 do LCD_PH_Send(bgcolor, 1);
  LCD_PH_Set_XY(0,0,131,131); < this
End;

Procedure LCD_PH_Chr(x,y,kar : byte);
var i,j,s : byte;
Begin
     j := y + (7 * fsize) - 1;

     LCD_PH_Set_XY(x,y,131,j); < this

     For j := 0 to 6 do
        For s := 1 to fsize do LCD_PH_Send(fbcolor, 1);
     
     LCD_PH_Chr_CP(kar);
     
     For i := 2 to fsize do
       begin
     For j := 0 to 6 do
       begin
        For s := 1 to fsize do LCD_PH_Send(fbcolor, 1);
      end;
      end;
End;

procedure Draw_RGB;
var p1,p2 : byte;
begin
  LCD_PH_Set_XY(0,0,131,131);< this
  for p2 := 0 to 131 do
    begin
      for p1 := 0 to 32 do LCD_PH_Send(RED,1);
      for p1 := 0 to 32 do LCD_PH_Send(GREEN,1);
      for p1 := 0 to 32 do LCD_PH_Send(BLUE,1);
      for p1 := 0 to 32 do LCD_PH_Send(WHITE,1);
      ClrWdt;
    end;
end;

procedure Draw_RYB;
var p1,p2 : byte;
begin
  LCD_PH_Set_XY(0,0,131,131);< this
  for p2 := 0 to 131 do
    begin
      for p1 := 0 to 43 do LCD_PH_Send(RED,1);
      for p1 := 0 to 43 do LCD_PH_Send(YELLOW,1);
      for p1 := 0 to 43 do LCD_PH_Send(BLUE,1);
      ClrWdt;
    end;
end;
In my opinion I consider that is the right way.

Best regards, Florin Medrea.

Posted: 12 May 2007 15:40
by joseLB
yo2lio wrote:Hi JoselB,
I want to make a remark ......
Hi Florin, I think I was misunderstood...
The idea was to take a library from someone else that was not meant to be using MakroIt and make a test to see if MakroIt would work on that situation, "real world".
So, I submited makroIt and the generated code to you so you take a look, and mainly as a strong contributor to the forum and developer, to see if MakroIt would be of any usage for you. Just that...

In no way I was creating a "new version", "distributing", etc., etc. The only goal where the above ones:
1- it works in real world?
2- Florin thinks that it could be a good tool?
By the way, I deleted that entry in thread.
Regards
Jose

Posted: 25 Jun 2008 17:24
by pointser
nokia 6100 display is the same of nokia 6111 display?
thanks

Posted: 21 Mar 2009 15:23
by Thomas K
Is it possible to use a PIC18F452?
And i only have a 8Mhz and 20Mhz crystal, not a 10Mhz - can I use those?

Posted: 28 May 2009 22:21
by Lazarus
Hi!
I purchase a Nokia 6100 Breakout Board from Sparkfun and i connect this with a PIC18F4620, Xal 40Mhz, etc...
But the screen is BLUE !!! Nothing appear with your code...
Could you help me ?

Best Regards

Posted: 29 May 2009 12:50
by YU2AX
Donald Shimoda wrote: have a lot of sense because WINME is a Virus. Is the poor OS never writed.
Wow !!! :idea:

Re: LIBRARY for NOKIA 6100 COLOUR LCD 132x132 pixels

Posted: 30 Jan 2013 10:27
by rasheedsuun
This is a great blog posting and very helpful.