Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LCD 4x20 initialization

Status
Not open for further replies.

Setsuna13

Junior Member level 1
Joined
Jul 6, 2011
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,416
Please help me...

Could anyone share a URL/Schematic/Code that will initialize a 4x20 LCD using PIC16f877a

here's the datasheet for the LCD http://www.e-gizmo.com/PRODUCT/ELECTRO/Datasheet/Display/sc204a.pdf

I have a 2x16 lcd and I have already initialize it using this code **broken link removed**
Could I use the code in 2x16 initialization for my 4x20 lcd? or could anyone modify the code for initialization of the 4x20 lcd?

Thanks...
 

Hi,

The 4x20 lcd will run from a 2x16 lcd code, there is no difference in the hardware connections.
You can use either 4 bit or 8 bit mode .

If you read this lcd tutorial you will see that the only difference between x2 and x4 lines is the software 'line' address for the data.
Again there is no difference in going up from 16 to 20 characters per line.

EPE FAQs & Resources
 

so in this 2x16 initialization **broken link removed** I do not need to modify anything? because on the part on the LCD initialization, it says on the comment that "Function Set to 8 bits, 2 lines and 5x7 dot matrix"...

:) If you have an initialization code could you please share it to me... I am not really good in writing codes... I'm just a newbie when it comes to microcontrollers...

thanks...
 

Hi,

That code does not build because it specifies the LIST - 877a and include - 873a chip, which one have you used ?
 

hmmmm... I am using pic16f877a... could you share a link where I can get a code that I could compile? I have seen many tutorials but I cannot understand what to do and how I will write the code...
 

Hi,

Here is that code fully working as you can see in the picture.
It runs on the 2x16 or 4x20 display without modification, on the 4x20 display it uses it as a 2x16 display

I have also added another picture showing the extra parts needed to run , just add all the power lines to the pic chip

The lcds only have '1 or 2 lines' - if you see that tutorial you will see what I mean.

There are many slightly different ways of doing the code for a lcd, don't have time at the moment to go though that code to modify it for '4 lines', but will try later, time permitting.

ps - the lcd routine very handy to have working , but its a difficult one to follow, suggest once you know how to add in your own messages you just use the code and concentrate on learning other basic things first.
 

Attachments

  • lcd8bit.rar
    83.3 KB · Views: 150

Hi,

Attached is the code for the 4x20 lcd, see the beginning of the code for an explanation.

First run the 2x16 code on your 4x20 display to prove it all works ok, then run this code, it should run providing the display addresses are the same as the LM044 display I simulated it on, let me know if it does not work as shown in the jpeg.
 

Attachments

  • lcd4x20.rar
    45.1 KB · Views: 133

thank you very much for your help... :D I will post again if I need help...thank you very very much...
 

my lcd won't display properly... what could be the reason when I am having black squares in line 1 and 3??

I have tried changing my microcontroller but I still get the same problem... I already check the wiring and soldering...
 

Hi,

Does the 16x2 program run ok on it ?

Does lines 2 and 4 display the correct message as shown in the jpeg ?
 

Hi,

Try this version with different lcd addresses, if it doesn't work please say what displays and answer previous questions.
 

Attachments

  • lvd4x20v2.rar
    3.1 KB · Views: 94

the 16x2 lcd runs properly on the code...

the line 2 and 4 does not display anything...

ok thanks I will try it...

---------- Post added at 19:10 ---------- Previous post was at 18:39 ----------

I'm still having the same problem... black squares on line 1 and 3... no display on line 2 and 4..

what are the possible problems if black squares appearing on the lcd??
 

Hi,

The black square are where those lines are not getting addressed.

The datasheet does not make it clear what addresses the 4 lines are.

Just to clarify what you have done.

You have 3 codes, the 8bit 2x16, 8bit 4x20 and 8bit 4x20 v2.

Are you saying you have run the 2x16code on your 2x16 display ok.

Have you run the 2x16 code on the 4x20 display and what are the results ? line1 and 2 properly displayed ?
 

please giving me coding for lcd 2 x 16 LMD16L using PIC 16F877A
 

we have a problem also, we use pic18f4550, using the 20x4 liner but it did not work in the hardware, in proteus it works fine..just a simple code...it did not shown anything in the hardware
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top