Graphical LCD With Atmega32

Go To Last Post
34 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone;

                       I have decided to start working with a graphical LCD. I have one JHD12864E. I am very new with graphical LCD. Kindly suggest me how to start with it. I tried three tutorials but nothing I working.

This topic has a solution.
Last Edited: Wed. Apr 18, 2018 - 11:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You already have a thread on this: https://www.avrfreaks.net/forum/tft-display-atmega32

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Abhay02 wrote:
I tried three tutorials but nothing I working.
Which tutorials? Also describe exactly what "nothing working" really means.

 

BTW I find it highly ironic that Andy who usually argues for threads not drifting off topic to suggest that it's not valid for you to have created a new thread now you have switched from the "picking display" (subject of previous thread) to actual implementation on 12864 (this thread) cheeky

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was working on the GLCD but also looking TFT Display. Now I have decided to go with GLCD only.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BTW have you tried this one?...

 

http://en.radzio.dxp.pl/ks0108/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No.. I am going to try it after one code which already I am trying.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In this link there is no description of connections??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am getting this error when I am compiling this code.

 

I am getting this error when I am compiling this code.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ZIP up your AS7 project and attach it to your message.
Someone might build your project on real hardware and debug it for you.
.
It is always best to start with examples provided with a library to verify your hardware.
Then adapt for your own requirements.
.
Engineering is all about making the best use of standard proven resources and tools.
It also means that members from anywhere in the world can help you.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Give this a shot....seems to be clearly written for the JHD12864E display

 

http://www.electronicwings.com/avr-atmega/graphical-lcd-128x64-interfacing-with-atmega1632

When in the dark remember-the future looks brighter than ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LCD

 

 

   I have this Graphical LCD with me..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://drive.google.com/drive/folders/1VO7bYIiUmVzNZImHIEFS-OlhjGjokseL?usp=sharing

 

This code is working fine in Proteus simulation with AMPIRE 128X64 display (avilable in Proteus Simulator), but on hardware it is not working.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not working on simulation and hardware also.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go on.   Please give accurate information.

 

Does your project in #12 work in Proteus Simulation or not?

 

I would be fairly confident that Proteus can simulate a KS0108 display accurately.

So if the simulation works you should check the hardware for:

1.  the wiring matches the schematic

2.  the JTAG is disabled on the AVR.

 

Personally,   I would try the proven examples from #10 using those schematics and tutorial.

Verify that your hardware is working.   Then you can use Proteus to simulate the proven ElectronicWings examples.

 

If the Proteus Simulation fails you can blame Proteus.    But I would be pretty confident Proteus should work ok.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Project #12 is properly working on Proteus Simulator.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using ATMEGA32 and its fuse settings are: High Fuse =>0xD9 and Low Fuse => 0xFF.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Abhay02 wrote:

Not working on simulation and hardware also.

Why did you say this in #13 ?

 

Are you located in Europe or in India?

Have you followed my advice in #14 ?

 

It is best to print the schematic on paper.   Then you can verify each wire with a DMM.   Tick off each wire with a pencil as you go.  (or highlight the wire with a flourescent marker pen)

 

Seriously,   being methodical with your wiring tests might cost 10 minutes from your life.   You have already wasted a week on this "problem".

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Abhay02 wrote:

I am using ATMEGA32 and its fuse settings are: High Fuse =>0xD9 and Low Fuse => 0xFF.

You can check fuses from http://www.engbedded.com/fusecalc/

 

JTAG is disabled.   You must have a crystal for the AVR to work.   If the AVR programmer upload your HEX file,  the crystal must be ok.   Your link in #12 does not show a crystal in "connections.png"

 

David.

Last Edited: Tue. Apr 17, 2018 - 11:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am from India I am working in Embedded Field from last 2 Years. Fuse settings are OK, I have already checked it, after checking it I have replied to you. 

 

Project #12 is working fine on Proteus but not working on hardware.

 

Project #10 was not working on Proteus as well as on the hardware(This line was a reply on the #10 comment).

 

Circuits and all things are proper after working 2 Years in Embedded I think I can check the connections properly.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

after working 2 Years in Embedded I think I can check the connections properly.

That is not the best attitude...always welcome the suggestions---we have already learned the hard way, believe it! 

Please take a look at http://www.electronicwings.com/avr-atmega/graphical-lcd-128x64-interfacing-with-atmega1632 for lots of info.

When in the dark remember-the future looks brighter than ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I built his project from #12. It works fine on real hardware with active-high CSn pins.
.
Obviously, Ohms Law behaves differently in India.
.
Most common KS0108 displays have active-high CSn pins. The radzio code expects active-low CS.
The ElectronicWings tutorial works straight out of the box with active-high CS.
.
David.

 

Edit.   I note that the PNG of the AMPIRE128X64 display that apparently is used in the Proteus Simulation has got active-low /CS1 and /CS2 pins.   So it would be worth checking your Proteus documentation.

Most importantly,   check whether your module matches the unusual AMPIRE pinout and polarity.

 

The JHD12864E has this pinout.   Which implies active-high CS1, CS2 pins.   This is the most common form of KS0108 display module pinout.

 

Graphical LCD pin diagram

Last Edited: Tue. Apr 17, 2018 - 05:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just Stop telling about my Country.. 

If you can help me out that is good if not that will also good.

But never try to say a single bad word about my country.

I don't know from which country you belong but you need to think twice before commenting on any country. You are not behaving professionally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I replied in that manner because someone maintain my country name there and it was not required.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who said anything about being professional? Is there money involved?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is this a local kind of website?? Where if have knowledge of AVR then you can insult anyone's country??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thing money involvement won't make you a professional. It come from the knowledge and if someone have knowledge that doesn't means that he can comment on anyone's country. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I asked for your country in #17.
I had suggested in #14 that you check your wiring.
I come from England where we often make wiring errors.
.
Your project code from #12 works on a real KS0108 in England. My GLCD has the same pinout and looks similar to the picture in #21 but is a different brand.
I do not have a Proteus licence. Your AMPIRE lcd does not match the JHD12864E. I can not run a Prroteus simulation.
.
I do not want to offend you. There are members from every country in the world. It is an international forum. We follow world conventions for pin names, pin numbering, schematic wirimg, ...
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Different brand so may be some pins can be different or may be GLCD is faulty?? Or micro controller can be it self faulty??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Abhay02 wrote:

Different brand so may be some pins can be different or may be GLCD is faulty?? Or micro controller can be it self faulty??

 

All of those things are possible but only you can find out if any are.

 

1) You need to use a display which has a datasheet detailing the connections or...

2) You need to figure out what the connections to your display are.

 

Once you know the connections are correct you need to prove the controller is working correctly. Write some code which exercises the port pins and prove they work.

 

Now you know you have a working controller and good connections.

 

So write some code, step by step, which tests your display. Start with simple commands which build upon each other. Can you initialise the display? Can you clear the display? Can you set the display to one solid colour? Can you set a single pixel?

"This forum helps those that help themselves."

"How have you proved that your chip is running at xxMHz?" - Me

"If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In #1 you say that you have a JHD12864E.
In #11 you show a photo of the pcb.
.
If you have a different brand of GLCD please quote the actual brand and model (and a link to the sale website if possible)
.
The GLCD and AVR will both work fine when new.
If you have let smoke out of either device they are unlikely to work.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Post #11 have my GLCD image..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Google finds this photo of the JHD12864E pcb

Image result for jhd12864e

JHD12864E is clearly printed on the pcb.   Your photo in #11 is slightly different.

 

I suggest that you ask the shop what actual make and model that you bought from them.

 

JHD12864E has the common pinout.  e.g. CS1 on pin#15,  CS2 on pin#16,  /RST on pin #17.

You will just need to compare pcb traces to see what your pinout is.

 

Incidentally the GLCD that I am using is TG12864B.   128x64 KS0108 style GLCDs have 3 black blobs.

 

David.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you everyone now GLCD is working fine..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well don't keep us in suspense. What was the issue? Was it the inverted chip selects that David identified or something else?