electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

INTERFACING GRAPHIC LCD


Goto page 1, 2  Next
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> INTERFACING GRAPHIC LCD
Author Message
nitinrakheja



Joined: 15 Sep 2006
Posts: 2


Post15 Sep 2006 11:15   

ssd1289


I am trying to procure a graphic LCD and interface it with pic18F452 or pic16F877A . Can some one please guide me which LCD should i procure and the way of programming it. I am using "mikroc" . i think it supports only 128x64 GLCD. Please send in help at nitinrakheja(at)yahoo.com
thanx
Back to top
cristianp



Joined: 04 Jul 2006
Posts: 81
Helped: 9
Location: Romania


Post15 Sep 2006 12:20   

mikroc glcd


You can use a GSM LCD display.
Some link's with project that use different types of LCD's:
- Nokia 6100 LCD: http://thomaspfeifer.net/
- Nokia 3310 LCD http://www.microsyl.com/

More information could be found at http://forum.lcdinfo.com/index.php

Regards,
Cristian
Back to top
Code Warrior



Joined: 30 Dec 2004
Posts: 224
Helped: 7


Post15 Sep 2006 15:42   

glcd mikroc


What is the logic behind graphics LCD. For example 128X64. How to drive this.
Back to top
TechToys



Joined: 16 May 2006
Posts: 151
Helped: 17


Post16 Sep 2006 4:22   

ssd1289 datasheet


Have interfaced

1. T6963C LCD with 16F877a. Can be modified for resolution other than 128x64 by changing the MAX_WIDTH and MAX_HEIGHT
2. A color LCD of 128x160. Controller is Samsung S6B33BC. The uP is 18LF4550. The intention is to develop a photo album with SD card.
3. Not related to PIC, but this project is more involved with AT89S52. The LCD is KS0108-based 128x64 LCD.

All source code download at

www.TechToys.com.hk

Because all three LCDs requires 8-bit parallel port, they can be accessed via discrete I/O manner, or memory mapped manner. All examples above make use of discrete I/O manner for easier porting to other uPs. However, the side effect is that, the operation is slower. For faster and more efficient LCD access, memory mapped method should be used.

John
Back to top
jaime



Joined: 15 Jul 2005
Posts: 39
Helped: 2
Location: Porto-Portugal


Post22 Sep 2006 23:40   

interfacing graphic lcd


humm..

photo album will be nice...

are you working on it??

Added after 35 minutes:

humm..

photo album will be nice...

are you working on it??
Back to top
TechToys



Joined: 16 May 2006
Posts: 151
Helped: 17


Post23 Sep 2006 6:42   

graphic lcd interfacing


Quote:
photo album will be nice...

are you working on it??


Yes, please refer to my web site at www.TechToys.com.hk

Right now, the USB Mass Storage works nice (as it is a Microchip application anyway!). Color LCD also working, in the sense that I could display a picture of 65k color on screen. There remains to write the jpeg decode software for the PIC. Honestly, no idea how to do it yet. Any link or comment would be welcome.

John Leung
Back to top
Darth.Vader



Joined: 03 Jan 2002
Posts: 51
Helped: 1
Location: France


Post01 Jun 2007 1:45   

glcd interfacing


heya Very Happy

the 2.2" TFT LCD module on PCB with CAT32 LED driver is a interresting toy for 40$ ...
I think i am going to get one or 2 from you Smile

i mail you soon

cya
Back to top
TechToys



Joined: 16 May 2006
Posts: 151
Helped: 17


Post19 Jun 2007 4:58   

how to drive graphic lcd


Thank you. and I have just updated the driver the that 2.2" TFT LCD module for PIC18. However, its full power has not been unladhed yet. It should be able for animation display. Still working on it.



John Leung
www.TechToys.com.hk
[img][/img]



Sorry, but you need login in to view this attachment

Back to top
Prabakaran



Joined: 22 Jan 2007
Posts: 160
Helped: 5
Location: Chennai(India)


Post19 Jun 2007 14:38   

graphic lcd interface


Hope the Pic Complier have the sample code of Driving the Graphical LCD . Try to that code and share the ideas what the problem ur facing while interfacing.
Back to top
Darth.Vader



Joined: 03 Jan 2002
Posts: 51
Helped: 1
Location: France


Post20 Jun 2007 18:57   

ssd1289.c


TechToys , you are true when you say for ... animation Wink
I have send you my Rotating 3D cube and a BreakOut Game.
You will see that the display do it very ''Fluid'' Smile
I have to implement some other routines on the SSD1289 driver , but as
you will see , it's ROCK ! Very Happy
What you have to look on programming is that you never go outside the screen
with your Pixels coordinates , or the screen become flashy when he try to write outside the coords .
Another point to know is that you need a routine like Delay_Cycles(1); when your
PIC run at more than 32Mhz. (Only in the LCD_CMD and LCD_Data routines) ,
or the screen will loose data or interpret wrong commands.
but well , with the speed of this TFT i think we can do ALOT fun stuff !!

Cya latter , i have a TFT to play with Wink
Back to top
Darth.Vader



Joined: 03 Jan 2002
Posts: 51
Helped: 1
Location: France


Post23 Jun 2007 1:15   

ssd1289 driver


heya all Smile

I post my SSD1289 driver here.
It's to control the 2.2" color TFT from Techtoys.

@ Techtoys : apparently your mailbox dont allow zipped file , fix it Smile

On this file you will found 2 "CCS C " project.

One is a 3D Cube rotating on the screen .
The other is a Breakout , just one level , programmed in like 30min to show
how the screen work.
The Hex files are for PIC18F4680 , but you can use smaller PIC easy , it take
very low ammount of ROM/RAM (the 3D Cube a little more because the pre calculate sin/cos table).
The SSD1289.c file is the TFT controller driver itself.
So , i think i say you all you need to know.
Other info are on readme.txt Wink

Enjoy !



Sorry, but you need login in to view this attachment

Back to top
Darth.Vader



Joined: 03 Jan 2002
Posts: 51
Helped: 1
Location: France


Post24 Jun 2007 17:43   

working with ssd1289


Hi Wink

All my bla bla is ok but ... some pics from the result will be better.

INTERFACING GRAPHIC LCD

INTERFACING GRAPHIC LCD

INTERFACING GRAPHIC LCD

INTERFACING GRAPHIC LCD

I hope you found this litte project interresting for you Smile

Cya.
[/img]
Back to top
godlycean



Joined: 29 Apr 2008
Posts: 1


Post29 Apr 2008 22:12   

pic18f glcd


Hello,
I was wondering how you would go about changing the code for the PIC18f452, im still new to PICs and when i start looking at code i get lost. any ideas would be great. Im thinking about using the 24f to better use the display. Thank you
Back to top
Darth.Vader



Joined: 03 Jan 2002
Posts: 51
Helped: 1
Location: France


Post30 Apr 2008 17:51   

glcd ccs


Hi,

This driver will work on every Pic.
The only you have to change for other Pic model is the header you include in you main file, i use it for the 18F4680 , if you use the CCS C Compiler then juste make a new project with the project wizard and select your CPU.
Then copy/paste my code to your new project.
Now for use other pins from your cpu to control the screen just change the:
#define glcd_wr PIN_C0
#define glcd_rd PIN_C1
#define glcd_cs PIN_C2
#define glcd_cd PIN_C6
in what you want for your PIC , this some lines are in the drivers file ''SSD1289.c''
For the data port i use the 'D' port , if you have to use another port like the PortB then just replace all :
Output_D(.....); in Output_B(...);
Just as info , last time i was on TechToys page this screen was in grey , probably discontinued for better ones or bigger Wink
If you want to use that screen better than with a 8 bits controller , then look that your controller can adresse a full 16Bits port for send the data to the 16 bits data port from the screen , it can then be 2x faster.
But be carrefull how fast you send the data !! , or you will get glitch or your screen will not work.
Atm , i use the 18F4680 at 40Mhz (10 Mips) and it work like a charm.

Cya Wink
Back to top
Sayem Ahmed



Joined: 07 Apr 2008
Posts: 47
Helped: 3
Location: Dhaka,Bangladesh


Post01 May 2008 4:11   

glcd_set_side


Good work.

I am starting with PIC18F452.

I have wondered that they have 1500+ byte's of RAM.

They are perfect for interfacing GLCD.
Back to top
piculator



Joined: 01 Jun 2008
Posts: 4


Post01 Jun 2008 15:03   

ccs glcd


Hey guys i'm extremely new at this, but have any of you tried to program a jhd12864 graphic lcd with a PIC18F452 or a PIC16F877A?
When i tried running the test program available in the mikroC manual, the graphics were out of focus and i'm not sure what is the matter... any ideas guys?
Back to top
XNOX_Rambo



Joined: 13 Jul 2002
Posts: 437
Helped: 87
Location: Far out, man!


Post01 Jun 2008 15:25   

how glcd works


Piculator, what is your Vo voltage at pin 3?

/Ram
Back to top
jit_singh_tara



Joined: 22 Dec 2006
Posts: 110
Helped: 6


Post03 Jun 2008 10:46   

pic32 glcd


i interfaced gdm12864a , ...its easy....
Back to top
piculator



Joined: 01 Jun 2008
Posts: 4


Post03 Jun 2008 14:19   

graphical lcd interface


Hey guys the thing is, the GLCD is actually functioning pretty well. But I can't seem to centralize the picture. As shown in the pic i've attached. I've tried using Library routines such as Glcd_Set_Side(0), yet I still get the same thing. Maybe it's because I do not know how to use it properly.


Sorry, but you need login in to view this attachment

Back to top
XNOX_Rambo



Joined: 13 Jul 2002
Posts: 437
Helped: 87
Location: Far out, man!


Post03 Jun 2008 15:37   

ssd1289 code


I have no experience of mikroC but I have checked the manual now.

Just to eliminate the simple things - are you using a PIC18?
It says in the manual that the GLCD routines only work with the PIC18 family.

/Ram
Back to top
piculator



Joined: 01 Jun 2008
Posts: 4


Post04 Jun 2008 17:36   

pic32 t6963c


Hello,

Yes I have currently changed my PIC to the PIC18F452, and also finally figured out how to display bmp pictures on it. Alas, it's still not centralized. I'd appreciate any suggestions. Thanks so much
Back to top
XNOX_Rambo



Joined: 13 Jul 2002
Posts: 437
Helped: 87
Location: Far out, man!


Post04 Jun 2008 23:41   

lcd 128x160 22 pins


From the looks of it you have an offset of 64 (educated guess) in your x axis somewhere.

Apparently the LCD has a T6963C controller chip and mikroC has special library routines for it - maybe you could try those instead.

/Ram
Back to top
Google
AdSense
Google Adsense




Post04 Jun 2008 23:41   

Ads




Back to top
piculator



Joined: 01 Jun 2008
Posts: 4


Post10 Jun 2008 5:57   

pic18f2550 graphic lcd


What is bugging me is that, it still remains the same even after I reprogram it. The picture is still cut in half.
I've tried looking for T6963C , unfortunately where I am, this model is unavailable. All I have is what is available here. It's really frustrating.
Back to top
enogogo



Joined: 07 Jun 2004
Posts: 112
Helped: 1


Post10 Jun 2008 9:37   

graphic lcd interfacing with pic


I have some broken cellulars with color lcds I want to use their screens, can you give some examples?
Back to top
XNOX_Rambo



Joined: 13 Jul 2002
Posts: 437
Helped: 87
Location: Far out, man!


Post10 Jun 2008 10:35   

pic32 graphic lcd


Hi Piculator,

If you check the application note for the JHD12864 from this site it seems to use a T6963C:
http://www.e-gizmo.com/PRODUCT/ELECTRO/LCD.HTM

/Ram
Back to top
Prabakaran



Joined: 22 Jan 2007
Posts: 160
Helped: 5
Location: Chennai(India)


Post18 Jun 2008 11:53   

file: pic32 t6963


Dear All,

I Am using the Graphical LCD T6963C Driver LCD (240 *128 Pixel). I Am using in Text Mode, when i am writing the Value to the Particular Address. Its writing to the Whole Display.

When i Am writing the Value A(0x21). to the Address location 2 . Its writing to the Whole Display. Can Anyone suggest me . How to write the Value to the Particular Address. How to initalise the Text Mode.
Back to top
ksp



Joined: 12 May 2007
Posts: 3
Location: Hyderabad


Post03 Oct 2008 8:14   

interface pic to glcd


Dear piculator,

Swap the GLCD pins "Chip Select 1" and "Chip Select 2" ie. Pins 15 and 16.

-ksp
Back to top
elvisjohndowson



Joined: 04 Apr 2006
Posts: 1


Post29 Nov 2008 10:20   

jhd12864 lcd


Hi,
I would like to know how to interface PIC32 to a Hitachi 8.0" LCD Touch Panel. The specifications for the touch panel can be found here: http://www.hitachi-displays-eu.com/faqs/pinfo3.asp?pno=TX20D19VM2BPA

If I buy a PIC32 development board, what additional hardware interfaces do I require, to drive the LCD display? I want to know the pre-requisites for connecting the two together, so that I can then work on the software application that will utilize the PIC32 and use the LCD touch panel as a graphical user interface.

Best regards,

Elvis Dowson
Back to top
vikky



Joined: 18 Oct 2007
Posts: 58


Post03 Dec 2008 14:25   

driving graphic lcd


Hello,

I am trying to interface graphical display of 1100(controller PCF8814) with AT Mega 16.I have pasted the program below.The LCD does not work.Please tell me if something is wrong.

#include<avr/io.h>
#include<avr/interrupt.h>
#include<util/delay.h>
#include<string.h>

#define BIT(x) (1 << (x))

#define CHECKBIT(x,b) x&b
#define SETBIT(x,b) x|=b;
#define CLEARBIT(x,b) x&=~b;
#define TOGGLEBIT(x,b) x^=b;

#define SCE 0x08
#define DC 0x04

volatile char pixel_lookup[8]={0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};

static const unsigned char font_lookup[96][5]=
{
{0x00, 0x00, 0x00, 0x00, 0x00},// (space)
{0x00, 0x00, 0x5F, 0x00, 0x00},// !
{0x00, 0x07, 0x00, 0x07, 0x00},// "
{0x14, 0x7F, 0x14, 0x7F, 0x14},// #
{0x24, 0x2A, 0x7F, 0x2A, 0x12},// $
{0x23, 0x13, 0x08, 0x64, 0x62},// %
{0x36, 0x49, 0x55, 0x22, 0x50},// &
{0x00, 0x05, 0x03, 0x00, 0x00},// '
{0x00, 0x1C, 0x22, 0x41, 0x00},// (
{0x00, 0x41, 0x22, 0x1C, 0x00},// )
{0x08, 0x2A, 0x1C, 0x2A, 0x08},// *
{0x08, 0x08, 0x3E, 0x08, 0x08},// +
{0x00, 0x50, 0x30, 0x00, 0x00},// ,
{0x08, 0x08, 0x08, 0x08, 0x08},// -
{0x00, 0x30, 0x30, 0x00, 0x00},// .
{0x20, 0x10, 0x08, 0x04, 0x02},// /
{0x3E, 0x51, 0x49, 0x45, 0x3E},// 0
{0x00, 0x42, 0x7F, 0x40, 0x00},// 1
{0x42, 0x61, 0x51, 0x49, 0x46},// 2
{0x21, 0x41, 0x45, 0x4B, 0x31},// 3
{0x18, 0x14, 0x12, 0x7F, 0x10},// 4
{0x27, 0x45, 0x45, 0x45, 0x39},// 5
{0x3C, 0x4A, 0x49, 0x49, 0x30},// 6
{0x01, 0x71, 0x09, 0x05, 0x03},// 7
{0x36, 0x49, 0x49, 0x49, 0x36},// 8
{0x06, 0x49, 0x49, 0x29, 0x1E},// 9
{0x00, 0x36, 0x36, 0x00, 0x00},// :
{0x00, 0x56, 0x36, 0x00, 0x00},// ;
{0x00, 0x08, 0x14, 0x22, 0x41},// <
{0x14, 0x14, 0x14, 0x14, 0x14},// =
{0x41, 0x22, 0x14, 0x08, 0x00},// >
{0x02, 0x01, 0x51, 0x09, 0x06},// ?
{0x32, 0x49, 0x79, 0x41, 0x3E},// @
{0x7E, 0x11, 0x11, 0x11, 0x7E},// A
{0x7F, 0x49, 0x49, 0x49, 0x36},// B
{0x3E, 0x41, 0x41, 0x41, 0x22},// C
{0x7F, 0x41, 0x41, 0x22, 0x1C},// D
{0x7F, 0x49, 0x49, 0x49, 0x41},// E
{0x7F, 0x09, 0x09, 0x01, 0x01},// F
{0x3E, 0x41, 0x41, 0x51, 0x32},// G
{0x7F, 0x08, 0x08, 0x08, 0x7F},// H
{0x00, 0x41, 0x7F, 0x41, 0x00},// I
{0x20, 0x40, 0x41, 0x3F, 0x01},// J
{0x7F, 0x08, 0x14, 0x22, 0x41},// K
{0x7F, 0x40, 0x40, 0x40, 0x40},// L
{0x7F, 0x02, 0x04, 0x02, 0x7F},// M
{0x7F, 0x04, 0x08, 0x10, 0x7F},// N
{0x3E, 0x41, 0x41, 0x41, 0x3E},// O
{0x7F, 0x09, 0x09, 0x09, 0x06},// P
{0x3E, 0x41, 0x51, 0x21, 0x5E},// Q
{0x7F, 0x09, 0x19, 0x29, 0x46},// R
{0x46, 0x49, 0x49, 0x49, 0x31},// S
{0x01, 0x01, 0x7F, 0x01, 0x01},// T
{0x3F, 0x40, 0x40, 0x40, 0x3F},// U
{0x1F, 0x20, 0x40, 0x20, 0x1F},// V
{0x7F, 0x20, 0x18, 0x20, 0x7F},// W
{0x63, 0x14, 0x08, 0x14, 0x63},// X
{0x03, 0x04, 0x78, 0x04, 0x03},// Y
{0x61, 0x51, 0x49, 0x45, 0x43},// Z
{0x00, 0x00, 0x7F, 0x41, 0x41},// [
{0x02, 0x04, 0x08, 0x10, 0x20},// "\"
{0x41, 0x41, 0x7F, 0x00, 0x00},// ]
{0x04, 0x02, 0x01, 0x02, 0x04},// ^
{0x40, 0x40, 0x40, 0x40, 0x40},// _
{0x00, 0x01, 0x02, 0x04, 0x00},// `
{0x20, 0x54, 0x54, 0x54, 0x78},// a
{0x7F, 0x48, 0x44, 0x44, 0x38},// b
{0x38, 0x44, 0x44, 0x44, 0x20},// c
{0x38, 0x44, 0x44, 0x48, 0x7F},// d
{0x38, 0x54, 0x54, 0x54, 0x18},// e
{0x08, 0x7E, 0x09, 0x01, 0x02},// f
{0x08, 0x14, 0x54, 0x54, 0x3C},// g
{0x7F, 0x08, 0x04, 0x04, 0x78},// h
{0x00, 0x44, 0x7D, 0x40, 0x00},// i
{0x20, 0x40, 0x44, 0x3D, 0x00},// j
{0x00, 0x7F, 0x10, 0x28, 0x44},// k
{0x00, 0x41, 0x7F, 0x40, 0x00},// l
{0x7C, 0x04, 0x18, 0x04, 0x78},// m
{0x7C, 0x08, 0x04, 0x04, 0x78},// n
{0x38, 0x44, 0x44, 0x44, 0x38},// o
{0x7C, 0x14, 0x14, 0x14, 0x08},// p
{0x08, 0x14, 0x14, 0x18, 0x7C},// q
{0x7C, 0x08, 0x04, 0x04, 0x08},// r
{0x48, 0x54, 0x54, 0x54, 0x20},// s
{0x04, 0x3F, 0x44, 0x40, 0x20},// t
{0x3C, 0x40, 0x40, 0x20, 0x7C},// u
{0x1C, 0x20, 0x40, 0x20, 0x1C},// v
{0x3C, 0x40, 0x30, 0x40, 0x3C},// w
{0x44, 0x28, 0x10, 0x28, 0x44},// x
{0x0C, 0x50, 0x50, 0x50, 0x3C},// y
{0x44, 0x64, 0x54, 0x4C, 0x44},// z
{0x00, 0x08, 0x36, 0x41, 0x00},// {
{0x00, 0x00, 0x7F, 0x00, 0x00},// |
{0x00, 0x41, 0x36, 0x08, 0x00},// }
{0x08, 0x08, 0x2A, 0x1C, 0x08},// ->
{0x08, 0x1C, 0x2A, 0x08, 0x08} // <-
};

void lcd_cmd(unsigned char cmd);
void lcd_data(unsigned char cmd);

void lcd_goto_xy(char x,char y)
{
y=y|0x40;
lcd_cmd(y);
x=(x*6)|0x80;
lcd_cmd(x);
}

void lcd_char(unsigned char character)
{
unsigned char j=0;
for(j=0;j<5;j++)
lcd_data((font_lookup[character-32][j] << 1));

}



void lcd_string(unsigned char font,unsigned char *string)
{
if(font==1)
{
unsigned char j;
lcd_cmd(0xae);
while(*string!='\0')
{
for(j=0;j<5;j++)
lcd_data((font_lookup[*string-32][j] << 1));
lcd_data(0x00);
string++;
}
}

lcd_cmd(0xaf);

}

void lcd_num_char(unsigned char num)
{
unsigned char H=0,T=0,O=0,j=0;
H=num/100;
T=(num - (H*100))/10;
O=(num - (H*100) - (T*10));

for(j=0;j<5;j++)
lcd_data(font_lookup[H+16][j]);
for(j=0;j<5;j++)
lcd_data(font_lookup[T+16][j]);
for(j=0;j<5;j++)
lcd_data(font_lookup[O+16][j]);

}

void lcd_num_int(unsigned int num)
{
unsigned char TT=0, TH=0, H=0, T=0, O=0, j=0;

TT=num/10000;
TH=(num-(TT*10000))/1000;
H=(num-(TT*10000)-(TH*1000))/100;
T=(num - (TT*10000)-(TH*1000)-(H*100))/10;
O=(num - (TT*10000)-(TH*1000) -(H*100) - (T*10));
for(j=0;j<5;j++)
lcd_data(font_lookup[TT+16][j]);
for(j=0;j<5;j++)
lcd_data(font_lookup[TH+16][j]);
for(j=0;j<5;j++)
lcd_data(font_lookup[H+16][j]);
for(j=0;j<5;j++)
lcd_data(font_lookup[T+16][j]);
for(j=0;j<5;j++)
lcd_data(font_lookup[O+16][j]);
}
char x_line=0, y_line=0;





void Gotoxy(char x,char y){
lcd_cmd(0xB0|(y&0x0F)); // Y axis initialisation: 0100 yyyy
lcd_cmd(0x00|(x&0x0F)); // X axis initialisation: 0000 xxxx ( x3 x2 x1 x0)
lcd_cmd(0x10|((x>>4)&0x07)); // X axis initialisation: 0010 0xxx ( x6 x5 x4)
lcd_data(pixel_lookup[y]);
}

void lcd_pixel(char x, char y) // 40,36
{
unsigned char x_block=0, y_block=0;
//x_block=x/16;
y_block=y/8;
y=y%8;

y_block=y_block|0x40;
lcd_cmd(y_block);
x=x|0x80;
lcd_cmd(x);
lcd_data(pixel_lookup[y]);
}

void lcd_clear(void){
unsigned int i;
lcd_cmd(0x40); // Y = 0
lcd_cmd(0xb0);
lcd_cmd(0x10); // X = 0
lcd_cmd(0x0);
lcd_cmd(0xae); // disable display;
for(i=0;i<864;i++)
lcd_data(0x00);
lcd_cmd(0xaf); // enable display;
}
void lcd_init(void)
{

CLEARBIT(PORTA, SCE)
CLEARBIT(PORTA, DC)
_delay_ms(5); // 5mS so says the stop watch(less than 5ms will not work)
SETBIT(PORTA, DC)
lcd_cmd(0x20); // write VOP register
lcd_cmd(0x90);
lcd_cmd(0xA4); // all on/normal display
lcd_cmd(0xAf);//display on
lcd_cmd(0x2F); // Power control set(charge pump on/off)
lcd_cmd(0x40); // set start row address = 0
lcd_cmd(0xb0); // set Y-address = 0
lcd_cmd(0x10); // set X-address, upper 3 bits
lcd_cmd(0x00); // set X-address, lower 4 bits
lcd_cmd(0xC8); // mirror Y axis (about X axis)
lcd_cmd(0xad);//a1 // Invert screen in horizontal axis
lcd_cmd(0xac); // set initial row (R0) of the display
lcd_cmd(0x07);
//lcd_cmd(0xF9); //
lcd_cmd(0xaf); // display ON/OFF
lcd_cmd(0xa9);
//lcd_cmd(0xE8);
lcd_clear(); // clear LCD
lcd_cmd(0xa7); // invert display
_delay_ms(500); // 1/2 Sec delay
lcd_cmd(0xa6); // normal display (non inverted)
_delay_ms(1000); // 1 Sec delay //lcd_cmd(0x21);
//lcd_cmd(0xc8);
//lcd_cmd(0x06);
// lcd_cmd(0x13);
//lcd_cmd(0x20);
// lcd_cmd(0x0c);
}


void lcd_cmd(unsigned char cmd)
{
CLEARBIT(PORTA, DC)
CLEARBIT(PORTA, SCE)
//SPDR=0xFE;
//while(!(CHECKBIT(SPSR,BIT(7)))) {}

SPDR=cmd;
while(!(CHECKBIT(SPSR,BIT(7)))) {}

SETBIT(PORTA, SCE)

}
void lcd_cmd1(unsigned char cmd)
{
CLEARBIT(PORTA, DC)
CLEARBIT(PORTA, SCE)
SPDR=0xFF;
while(!(CHECKBIT(SPSR,BIT(7)))) {}

SPDR=cmd;
while(!(CHECKBIT(SPSR,BIT(7)))) {}

SETBIT(PORTA, SCE)

}



void lcd_data(unsigned char dat)
{
SETBIT(PORTA, DC)
CLEARBIT(PORTA, SCE)

SPDR=dat;
while(!(CHECKBIT(SPSR,BIT(7)))) {}

SETBIT(PORTA, SCE)
}


void spi_write(unsigned char senddata)
{

SPDR=senddata;
while(!(CHECKBIT(SPSR,BIT(7)))) {}

}

void lcd_circle(unsigned char cx, unsigned char cy ,unsigned char radius)
{
int x, y,xchange, ychange, radiusError;
x = radius;
y = 0;
xchange = 1 - 2 * radius;
ychange = 1;
radiusError = 0;
while(x >= y)
{
lcd_pixel(cx+x, cy+y);
lcd_pixel(cx-x, cy+y);
lcd_pixel(cx-x, cy-y);
lcd_pixel(cx-x, cy+y);
//lcd_pixel(cx-x, cy-y);
//lcd_pixel(cx+x, cy-y);
lcd_pixel(cx+y, cy+x);
lcd_pixel(cx-y, cy+x);
lcd_pixel(cx-y, cy-x);
lcd_pixel(cx+y, cy-x);
y++;
radiusError += ychange;
ychange += 2;
if ( 2*radiusError + xchange > 0 )
{
x--;
radiusError += xchange;
xchange += 2;
}
}
}

int main(void)
{
unsigned int i=0;
DDRB=0xff;
DDRA=0xff;
PORTA=0xff;
SETBIT(SPSR,0)
SPCR=BIT(6)+BIT(4)+BIT(3)+BIT(2)+BIT(0);

lcd_init();



Gotoxy(10,20);
lcd_string(1,"vikky");

while(1){}
return 0;
}



The hardware connections are as below

XRES----------->PA2
SCE------------->PA3
SDIN------------->PB5
SCK-------------->PB7
VDD and VDD1 are given 3.1V supply
VSS is ground.

Please help me to find out the problem.

With Thanks and Regards

Vikky
Back to top
ntfreak



Joined: 22 Feb 2002
Posts: 193
Helped: 5
Location: UK


Post12 Feb 2009 10:14   

glcd mikroc 16f887


elvisjohndowson wrote:
Hi,
I would like to know how to interface PIC32 to a Hitachi 8.0" LCD Touch Panel. The specifications for the touch panel can be found here: http://www.hitachi-displays-eu.com/faqs/pinfo3.asp?pno=TX20D19VM2BPA

If I buy a PIC32 development board, what additional hardware interfaces do I require, to drive the LCD display? I want to know the pre-requisites for connecting the two together, so that I can then work on the software application that will utilize the PIC32 and use the LCD touch panel as a graphical user interface.

Best regards,

Elvis Dowson


to use this with a pic32 you would need a display driver with a lot of ram.
For 16bit colour you would need 768k - SSD1962 or an equiv epson would do the job.

Cheers
ntfreak
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> INTERFACING GRAPHIC LCD
Page 1 of 2 All times are GMT + 1 Hour
Goto page 1, 2  Next
Similar topics:
Interfacing Graphic LCD MGLS240128T-02 (4)
question about graphic LCD interfacing to FPGA (1)
128x64 Graphic LCD Interfacing with PIC (2)
REQ: RAMTEX Graphic LCD driver library SED1335 LCD controlle (4)
help request for 128x64 lcd graphic lcd (1)
LCD graphic S1D15G00 (Nokia 6100 LCD) (1)
graphic lcd (15)
Graphic LCD (2)
Graphic LCD (2)
4bit graphic LCD (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS