Graphic LCD not working

Discussion in 'Embedded Systems and Microcontrollers' started by Zolyboy, Mar 13, 2013.

  1. Zolyboy

    Thread Starter New Member

    Mar 13, 2013
    5
    0
    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.

    [​IMG]
    [​IMG]

    Please help me If you can!
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    If you wish to post code put the text between code tags for small functions, or attach a zip file.

    [​IMG]
     
    • glcd.GIF
      glcd.GIF
      File size:
      70.2 KB
      Views:
      197
    Last edited: Mar 13, 2013
  3. Zolyboy

    Thread Starter New Member

    Mar 13, 2013
    5
    0
    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.
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    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:

    Code ( (Unknown Language)):
    1.  
    2.    Glcd_Fill(0x01);
    3.    Glcd_Fill(0x02);
    4.    Glcd_Fill(0x04);
    5.    Glcd_Fill(0x08);
    6.    Glcd_Fill(0x10);
    7.    Glcd_Fill(0x20);
    8.    Glcd_Fill(0x40);
    9.    Glcd_Fill(0x80);
    10.  
    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.
     
  5. Zolyboy

    Thread Starter New Member

    Mar 13, 2013
    5
    0
    I tried your code, but my Graphic lcd looks like as before. I posted here an image to show it.

    [​IMG]
     
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    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?
     
  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    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.
     
  9. Zolyboy

    Thread Starter New Member

    Mar 13, 2013
    5
    0
    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.
     
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    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.
     
  11. Synaps3

    Member

    Jun 5, 2013
    67
    2
    I have the exact same problem with a PIC18. Any suggestions?
     
  12. Synaps3

    Member

    Jun 5, 2013
    67
    2
    Solved. Updated to Proteus 8.
     
    ErnieM likes this.
  13. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    Cool, thanks for the update!
     
Loading...