Pages: [1]   Go Down
Author Topic: Questions on using a 4x40 display.  (Read 684 times)
0 Members and 1 Guest are viewing this topic.
South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to setup a 4x40 display. My understanding is that it functions like 2 - 40x2 displays.

Using the LiquidCrystal library it uses the 4 bit mode instead of the 8 bit mode. Should I have wired the unused inputs on the display to ground? At present all I get is both halves of the display the upper line is all solid blocks, and the second line is blank.

Thanks -
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am trying to setup a 4x40 display. My understanding is that it functions like 2 - 40x2 displays.
That is correct.  You should find that it has two enable pins, one for each half of the display.

Quote
Using the LiquidCrystal library it uses the 4 bit mode instead of the 8 bit mode.
You can use either the 4-bit mode or the 8-bit mode.  The code for the 4-bit mode is a little more complex to write but since you are using a pre-written library there is no reason for you to use the 8-bit mode.

Quote
Should I have wired the unused inputs on the display to ground?
This is one of the great mysteries of life but the general consensus is that it is unnecessary.

Quote
At present all I get is both halves of the display the upper line is all solid blocks, and the second line is blank.
Do you you have one line of blocks in total or one line for each half of the display?  Remember this is equivalent to two stacked 40x2 displays, not two side-by-side 20x4 displays.  

A line of blocks means that the display is not properly initialized.  This is almost always due to faulty wiring of one sort or another, even on those setups that are allegedly wired "correctly".  Also, In order to fully utilize your display you will need to use two instances of the LiquidCrystal library.  An easier method would be to look for and implement the LiquidCrystal440 library.


Don
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My display has a line of blocks on line 1 and line 3 with lines 2 & 4 blank.

I am initializing both halves, but only sending to the top lines.

Will look for the LiquidCrystal440 library.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How are you dealing with the two enable pins?

Don
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got hold of a copy of LiquidCrystal440 library and had to use Arduino022. Works when I load the sketch into my Arduino, and had not been working when I reset my Arduino but that seems to be working now...

Initially I had not connected RW to anything, but things started working when I connected it to ground. The mode I am using to controlling the 4 lines wanted RW hooked up so I redid the wiring and connected it to pin 9 on my Arduino.

Got looking at the code for the LiquidCrystal440 library and it has a mode that uses RS, RW, EN1 and EN2 and 4 data bits so I hooked it up that way and it appears to be working. I may do a little work with maintaining a memory buffer of the text I want to display so when the 4th line is filled the bottom 3 lines are scrolled and a blank line is inserted at the bottom of the screen. That mode should also work for other 4 line displays. Had to look at the library source to find the info, the documentation and the axample didn't really communicate real well what the various modes are.

Because of the way some of the examples were setup I am using pin 12 as RS, Pin 9 as RW, Pin 11 as Enable1, pin 10 as Enable2, pin 5 as d4, pin 4 as d5, pin 3 as D6 and pin 2 as d7. When I get to my final hardware I will probably  re-arrange them so there is some logical pattern that looks more like it makes sense.

Now to figure out what I can use as a keyboard. The individual I am working on this for is somewhat handicapped. She can read, and write(very slowly because of muscle control problems) and can communicate yes and no and her mom can make sense of some of her sounds. I think it might make it easier for visitors if she could communicate more easily. It is difficult to be there and talk to her and not being able to figure out what she would like to communicate back. (I sometimes wonder what she gets from my poor Spanish...)
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6936
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I can point you to my phi_prompt library. If you replace the library with liquidcrystal440 you have all the bells and whistles such as yes/no dialog, long message (just type away and the message is displayed with line wraps), there's also select lists and menus. You may want to use it as 20X4 first since you need to double its buffer to work on 40X4.

http://liudr.wordpress.com/phi_prompt/

I'm documenting some added functions so select list can be easily called like : response=simple_select_list("Menu:\nItem 1\nItem 2\nItem 3\n");
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Got hold of a copy of LiquidCrystal440 library and had to use Arduino022.
I seem to recall that the Arduino v1 version has a different name.

Quote
Initially I had not connected RW to anything, but things started working when I connected it to ground.
It's been a while since we had a rash of these so I no longer call out this problem specifically.  It's lumped into this statement from reply #1: This is almost always due to faulty wiring of one sort or another, even on those setups that are allegedly wired "correctly".

Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Should I have wired the unused inputs on the display to ground?
This is one of the great mysteries of life but the general consensus is that it is unnecessary.

I agree with Don that it is *usually* unnecessary.  On the other hand, I have never seen a case where it causes a problem.

I suggest tying them to ground unless it adds too much complexity to your project.
Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 25
ummm?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ressurecting an old thread, I know, but the LiquidCrystal440 library works seamlessly with an old leftover
'dual 2x40' I dug out of the basement.

t
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Ressurecting an old thread, I know, but the LiquidCrystal440 library works seamlessly with an old leftover 'dual 2x40' I dug out of the basement.

What's so surprising about that?  Is there any difference between a 'dual 2x40' and a 4x40, which is what the LiquidCrystal440 library was designed to drive.

Don
Logged

Pages: [1]   Go Up
Jump to: