Graphical LCD interfacing with AT89c51

Ian Rogers

Joined Dec 12, 2012
1,136
Port 0 hasn't any internal pullups, so I normally use 4k7, but 10 will be fine CS1, CS2, RS, RW and E need to be high when not being used..
 

Thread Starter

@vajra

Joined May 2, 2018
154
Port 3 is a good one to use...
Okay If I use port P3 then I will have not use to pullup resistor right ?

Please check the LCD connection of pin 3 (V0). Is it right ?
Code:
#define GlcdDataBus  P2
sbit RS  = P3^0;
sbit RW  = P3^1;
sbit EN  = P3^2;
sbit CS1 = P3^3;
sbit CS2 = P3^4;
 

jpanhalt

Joined Jan 18, 2008
11,087
With reference to this portion only and in view of the above discussion about Vo and Vee:
upload_2018-6-6_14-23-4.png

You have Vo tied directly to Vdd. That won't work. What is the purpose of the 220 (?) ohm resistor to ground? It will still be at Vdd voltage.
 

Ian Rogers

Joined Dec 12, 2012
1,136
Okay... There has been confusion!!! Vo is contrast... This will be around -15v... Pin 18 is Vout ( Vee ) and will give -17v, you need to put a pot like this... Connect pin 3 to Vee (pin 18) of the LCD... Connect pin 1 to 5V ( pin 2 ) and the center tap to Vo ( pin 3 )..

connect to 5v and ground..
Then adjust the pot until the contrast is black then back it off until the black just ( only just ) disappears...
Then when you run in the system the words will be viewable...

No need for pullups when using P3... I tend to use P3 to control external devices..
 

Ian Rogers

Joined Dec 12, 2012
1,136
No! It has to be a potential difference... So.... try two resistors
vout --- 1k----- Vo ---- 10k --- 5V.

If its too dark
Vout --- 2k-----Vo ----- 8k1 --- 5V.

Etc...

You are trying to get the contrast visible... Vo needs to be -13V ~ -15V ( ish ) with reference to 5V
 

Thread Starter

@vajra

Joined May 2, 2018
154
No! It has to be a potential difference... So.... try two resistors
vout --- 1k----- Vo ---- 10k --- 5V.
You are trying to get the contrast visible... Vo needs to be -13V ~ -15V ( ish ) with reference to 5V
Thank you Ian for being to the end.. God bless you

Thanks to all of you for your help...

I can show the message on screen

message.jpg
 
Top