Graphic LCD not working

Thread Starter

Zolyboy

Joined Mar 13, 2013
5
I made the connection between a pic pic16f877A mentioned in the title and a 128x64 graphic lcd in proteus and tried to write a simple program in mikroC. When i use GLcd_Fill(0xFF) everything is ok, my LCD screen is totally black. If I use GLcd_Fill(0), as I read this is the clear screen, i got horizontal lanes on the LCD screen (first white, second black, third white, fourth black.....). Can somebody explain me pls why this happens? I would like only a clear screen not a partially filled one. I attached my diagram and mikroC code.




Please help me If you can!
 

ErnieM

Joined Apr 24, 2011
8,377
If you wish to post code put the text between code tags for small functions, or attach a zip file.

 

Attachments

Last edited:

Thread Starter

Zolyboy

Joined Mar 13, 2013
5
That appears automatically when you create a Proteus project. I think it is the center of the page, and sorry that I posted the code as an image.
 

ErnieM

Joined Apr 24, 2011
8,377
OK, well it sounds like your one of your data lines is stuck high. I thought that may have been a VDD symbol or such (I don't use Proteus). See if this reproduced the problem:

Rich (BB code):
   Glcd_Fill(0x01);
   Glcd_Fill(0x02);
   Glcd_Fill(0x04);
   Glcd_Fill(0x08);
   Glcd_Fill(0x10);
   Glcd_Fill(0x20);
   Glcd_Fill(0x40);
   Glcd_Fill(0x80);
Pause on each line and see what the screen does.

If you see the same line you know what line is stuck, though I don't see why just one line would be stuck, and stuck high from the code you posted.
 

ErnieM

Joined Apr 24, 2011
8,377
OK, now I get your problem, it's not just a bit mis-set. But I don't see anything that could be causing this: looks like you took the example code from the microC library, made a circuit that follows all the pins, but got a weird result.

I see two minor things: MCLR is (NOT) MCLR, so it wants to be pulled high (I wonder why grounding it lets the circuit work... the simulator must ignore that).

The other long shot possibility is if you have low voltage programming enabled in the config settings. That could cause a conflict with the RW pin (but I doubt that).

I don't use that simulator. Does the simulator have any config settings for the display itself?
 

thatoneguy

Joined Feb 19, 2009
6,359
You are ignoring your Enable, Strobe, and R/W lines.

How is the data supposed to be clocked in, or the display know it's supposed to write data or return data, such as cursor position?

I'd say this is a Proteus glitch by allowing the LCD to even work at all.
 

ErnieM

Joined Apr 24, 2011
8,377
I'm not ignoring them. He seems to have them connected thru a bus structure.

The net names match on either end. Not my first choice but it seems correct.
 

Thread Starter

Zolyboy

Joined Mar 13, 2013
5
Thank you for your help guys! I don't see any configuration what can I set on the GLCD, it is a very strange and annoying problem... I tried with different microcontrollers but the result is the same... I dont' know... maybe i should change the GLCD to another one or to change PROTEUS to another program... If you can suggest me another program where I can test my hex file too I would be grateful.
 

ErnieM

Joined Apr 24, 2011
8,377
I don't have a simulator suggestion.

When I worked with a GLCD I built a board and had at the hardware itself. Armed with a PICkit (for in circuit programming and debugging) and occasionally a scope (to check timings) I was able to worry out my own code library for these devices.
 
Top