Go Down

Topic: Questions on using a 4x40 display. (Read 783 times) previous topic - next topic

kf2qd

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 -

floresta

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

kf2qd

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.

floresta

How are you dealing with the two enable pins?

Don

kf2qd

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...)

Go Up