Go Down

Topic: Help with display: 12864 / Controller ST7920 (Read 3738 times) previous topic - next topic

currymuetze

Hi everyone,

brief introduction: I have not much of a develloper skill, I know how to read and interprete codes though. I started with the Arduino a few weeks ago and I am currently building my own aqua controller. Currentlich I have finished the dimming of 4 different HighPowerLED-stripes. I am using a RTC for that.
Btw, I am from Germany but did not find much information in the German part of this forum.

My next step is adding an LCD display to it. I have a 12864 / Controller ST7920.
I want to display only text / ASCII in four rows.
There should be a change like every minute in the display like:
1) Show percentige of the Dim-status of each LED stripe (row1= "Blue: Dimmed by 55%") etc
2) Show Time (RTC) in hh/mm/ss
3) Show water temperaturer (later, not built yet)
and then loop back to 1.

Here we go:
I do have problems with the setup of my display. I was able to connect everything as shown in this thread:
http://www.arduino.cc/playground/Code/LCD12864
and installed the PONG game.
I could see the graphics but it was very dark.
I noticed I needed to setup a POTI but couldn't.

so my questions are now:
1) any good tutorial on the net where this is explained even for LCD beginners?
2) Do I need a POTI or is there any other way to get the screen lighter? I have a 4 WATT 4,7 kOHM Potz, can I use that and how do I connect it? (Do I connect it to the Arduino or to the display?)
3) Since I only would like to show ASCII / text, do I really need all these PINs connected?? I think it is quite a lot. (see below)

Hope that someone could help me
Thorsten

Wiring: (taken from the link I attached)

EN = Arduino Pin 18
RS = Arduino Pin 17
RW = Arduino Pin 16
D7 = Arduino Pin 7
D6 = Arduino Pin 6
D5 = Arduino Pin 5
D4 = Arduino Pin 4
D3 = Arduino Pin 11
D2 = Arduino Pin 10
D1 = Arduino Pin 9
D0 = Arduino Pin 8
CSEL1 = Arduino Pin 14
You also need to connect a POT with 5V on one side, ground on the other, and 5V (perhaps with 150 Ohm resistance) + LCD Pin 19 to the wiper (middle one usually). Otherwise you won't see much.

liudr

Yes, you need the POT1 in order to adjust contrast so you can see the image as sharply as possible.
No, you have to use all pins to even display texts. The screen treats everything as pixels, including the characters.

I strongly suggest you go with 20X4 HD44780-compatible character displays. They are so much easier to use and a lot easier to understand the code. Plus, only 6 arduino pins are needed. You still need a POT though.

Here is an online store where you can buy one:
http://www.adafruit.com/index.php?main_page=product_info&cPath=37&products_id=198
They have tutorials on how to hook it up.

Another place to buy:
http://www.sparkfun.com/products/256

You can also buy a shield for the display to save you from jumper wire spaghetti monsters.

currymuetze

hi,
well,the thing is that I already bought one of them...didnt expect it to be that hard to use.
would like to tra out first before gettig a new/other on.
anyone else who could help me?
thx

liudr

You can try a smaller character display for cheap: http://dipmicro.com/store/LCD-1602A-Y

Or you can go through this tutorial (instead of the one you pointed out):
http://www.arduino.cc/playground/Code/GLCDks0108

and dissect the code. You can print text with basic commands like:

Code: [Select]
  // display number of iterations in one second
  GLCD.ClearScreen();               // clear the screen 
  GLCD.CursorTo(13,2);              // positon cursor 
  GLCD.Puts("FPS= ");               // print a text string 
  GLCD.PrintNumber(iter);           // print a number


I've got a display like yours and I played with it as far as loading a demo. It's just too many wires and too complicated for my text-based projects.

currymuetze

ok, thx. I will think about using this one or gettings another one.
First will try to get this one working, we'll see.
So for the potentiometre...does the resistor factor matter? I have a 4,7kOhm.

currymuetze

What about this one if I wanna go with a different one:
LCD Display HD44780 4x20
=> the HD44780 2x16 ones are very simple ones for beginners. I would like to have a 4 char one though, since this one is also hd44780 I thought maybe it would work easy for me too.

floresta

#6
Feb 17, 2011, 02:00 pm Last Edit: Feb 17, 2011, 02:02 pm by floresta Reason: 1
Quote
2) Do I need a POTI or is there any other way to get the screen lighter? I have a 4 WATT 4,7 kOHM Potz, can I use that and how do I connect it? (Do I connect it to the Arduino or to the display?)


You need a potentiometer for just about any LCD display, graphical or character, but you have to connect it properly.  The hookup mentioned in your Playground link and quoted in the last sentence of your first post makes no sense.

For the most part the Graphical LCDs (GLCDs) require a negative voltage on the contrast pin (usually pin 3).  Many, if not most, of those displays have a negative voltage supply available on the pc board, typically on pin 18.  You connect the ends of the potentiometer to this negative supply and to GND and you connect the wiper to the contrast pin.  Some extended temperature character LCDs also require a negative voltage on the contrast pin.  You have to supply this voltage from an external source but the hookup is the same.  Some character LCDs give an acceptable display with the contrast pin connected to GND but most require a small positive voltage.  Connect the ends of the potentiometer to +5V and GND and connect the wiper to the contrast pin.

The potentiometer value is not at all critical.  Typically a 10K ohm pot is used.  A 5K pot will work, it just puts an unnecessarily larger drain on your power supply.  Use the potentiometer that you have now to get things functioning and replace it with a 10K value when you get one.


Don

floresta

#7
Feb 17, 2011, 02:09 pm Last Edit: Feb 17, 2011, 02:13 pm by floresta Reason: 1
Quote
well,the thing is that I already bought one of them...didnt expect it to be that hard to use.
would like to tra out first before gettig a new/other on.


This is not a good idea.  There are several variants of the GLCDs so you have to match your connections and your software to the one you have.  The character mode LCDs all use the same interface, the same library works with all of them, and they are just easier to get running and to use.  Cut your losses and go with the 20x4.



Quote
What about this one if I wanna go with a different one:
LCD Display HD44780 4x20
=> the HD44780 2x16 ones are very simple ones for beginners. I would like to have a 4 char one though, since this one is also hd44780 I thought maybe it would work easy for me too.


The 20x4 is no harder to use than the 16x2.  You use the same library and you can even use the same code.  The only difference is in how much information you can display.


Don

currymuetze

hey,
yea, already ordered the 20x4 one.
Did not really inform myself when I ordered the other one - did not expect it to be a difficult one.
However, lets hope I*ll get my self some bucks on ebay for that
Thx

Go Up