Text LCD




16 related questions:


48 comments:

12 Sep 2010

Photo shows different mbed pins hooked to LCD than example code and wiring table. Use wiring table!

12 Sep 2010

Here is another code example using other LCD functions (clear screen and locate) and a timer to display elapsed time:

  1. include "mbed.h"
  2. include "TextLCD.h"

TextLCD lcd(p10, p12, p15, p16, p29, p30); rs, e, d0-d3 Timer t;

int main() { Start timer t.start(); Clear LCD Screen lcd.cls(); wait(1); Print to LCD on first line lcd.printf("Hello LCD World!\n"); while (1) { Move cursor to start of second display line lcd.locate(0,1); Print elapsed time from timer on LCD lcd.printf("%e sec", t.read()); wait(.2); } }

12 Sep 2010

Sorry about the mess in last comment - looked OK in edit window. Preview does not seem to work right in my browser

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d0-d3
Timer t;

int main() {
// Start timer
    t.start();
// Clear LCD Screen
    lcd.cls();
    wait(1);
// Print to LCD on first line
    lcd.printf("Hello LCD World!\n");
    while (1) {
// Move cursor to start of second display line
        lcd.locate(0,1);
// Print elapsed time from timer on LCD
        lcd.printf("%e sec", t.read());
        wait(.2);
    }
}
17 Sep 2010

It is also possible to download eight custom character designs to the HD44780 LCD controller chip. There are numerous articles on the web and even web applications to draw characters and generate the character data. One such character design application is http://www.quinapalus.com/hd44780udg.html. The data sheet describes the download process to define new characters.

Update: Here is some mbed code to load new characters: http://mbed.org/users/DimiterK/notebook/custom-characters-on-hd44780/

22 Sep 2010

Just wondering if there's any reason that the specific pins used in the wiring diagram example are used? Can any pins be used for any of the lines. E.g. just use pins 15 to 20 for example?

27 Sep 2010

Having problems with an LCD? Notes from my first time use with a 16x2 unit.

My LCD needs 5V supply (Mbed pin 39)others might be 3.3V The LED backlight needs no current limiting resistor when run from the rated voltage. The contrast potentiometer resistor is required. The SIL connector type of display mates with a breadboard well. The DIL type needs an adapter or cable. The SIL connector pin numbering is weird. 14,13,12,11,10,9,8,7,6,5,4,3,2,1,16,15 (L to R display side) The connections used by this software are E,RS,D4,D6,D7 with R/-W permanently connected to VSS. Where the LCD software documentation mentions signal D0 it really connects to LCD pin D4, D1->D5,D2->D6 and D3->D7 Diagnostic check: If you have power connected correctly to the LCD and a Contrast pot set at one of the extremes, The LCD should show a display of 7 x 5 pixel blocks on the first line. If you don't get this the software cannot display anything.

02 Oct 2010

I had tuff time to make this working as I connected 3.3V vcc later I realized it needs to be +5 V dc (pin 39) !!!!!

04 Oct 2010

Some LCDs are 3.3V and some are 5V. The older ones tend to be 5V. The datasheet for the exact LCD module can be hard to find if you have an old one. If you buy a new one, they typically have the info on the power supply needed available in the data provided at the website. They all have the same controller chip and you can find that datasheet, but it can be 3.3V or 5V. If you hook up a 5V module to 3.3V, the LCD display will just be blank. And if you hook up the backlight - some need the resistor!

05 Oct 2010

Having great problems with this.

I have compiled and run the code, rewired and replaced both the MBED and my LCD controller.

For some reason am unable to get any Hello World appearing and I really do not even know what to try anymore.

Any suggestions would be great.

Thanks!

05 Oct 2010

So. Apparently my pot for contrast was bad. Make sure you check that!! The code does work.

07 Oct 2010

Is it possible to run a 40x4 LCD with the TextLCD.h? I don't see it mentioned. Thanks.

25 Oct 2010

I just uploaded a modified version of the TextLCD library to be able to support ST7036 based displays (like, for example, the DOGM162x-A). I know that a better solution would be to merge this into the original library, but haven't got the time to do this right now.

Please do a search for ST7036 or see http://mbed.org/users/leliep/libraries/TextLCD_ST7036/lgsmve

28 Oct 2010

Oliver Ryan wrote:

Is it possible to run a 40x4 LCD with the TextLCD.h? I don't see it mentioned. Thanks.

a 40x4 is infact a dual 40x2 display it contains two enable lines: E1 and E2. the datasheet of eg. the everboquet MC4004A is on this page: http://www.farnell.com/datasheets/302399.pdf. You have to adapt the progamm code! I'm using this display and i'm adapting the code. When its finished i will post it!

17 Nov 2010

Hello,

i'm trying to make reading back from the display work, but am having a hard time figuring this out, i know how it works, and doing it manually(manual enable after putting whole display full with text and then putting it in read mode) does work, but when i try to let the mBed doe it, it doesn't work. anyone has any idea?

19 Nov 2010

Jelmer Bruggink wrote:

i'm trying to make reading back from the display work, but am having a hard time figuring this out, i know how it works, and doing it manually(manual enable after putting whole display full with text and then putting it in read mode) does work, but when i try to let the mBed doe it, it doesn't work.

Perhaps you should tell what you have done so far. People might be able to help you easier that way.

22 Nov 2010

i've got a Optrex LCD (DMC20481 NY-LY-ABE) with a different timing. The enable puls has to be at least 75us instead of 40us and the clear screen command takes 3ms instead of 1.64ms. So i alter the TextLCD libary files on those points into a new OptrexLCD libary. I shall post this libary soon.

23 Nov 2010

Your wiring diagram contradicts the comments in your code!

23 Nov 2010

Thanks! Fixed.

23 Nov 2010

Hi Simon,

I am using this TextLCD library for an LCD20x4 type : the AV2040 of ANAG VISION (found @ Conrad). I have found the following problems and respective solutions that may help for a future release if it's OK for you :

1) the LCDType (enum in line 48 of TextLCD.h) is not used in the "Hello world" example of the Cookbook page : this example works only for the default LCD16x2 type !

2) when using the LCD20x4 type when calling the TextLCD class, a compilation error is : Identifier "LCD20x4" is undefined (E20).

3) consequently, I have modified the default LCDType = LCD20x4 in the TextLCD.h file only (nothing in the TextLCD.ccp file)

The code is : TextLCD lcd(p24, p26, p27, p28, p29, p30); /* rs,e,d0,d1,d2,d3,20 char's x 4 lines */

and the compilation is now OK and my LCD works very properly (I have written an interrupt driven frequencemeter with a fast partial LCD update which never failed).

I have not yet understood why the enum LCDType is "undefined". If this is fixed, I will use finally your library without change.

Thanks in advance !

23 Nov 2010

Dominique Bultez wrote:

I am using this TextLCD library for an LCD20x4 type : the AV2040 of ANAG VISION (found @ Conrad). I have found the following problems and respective solutions that may help for a future release if it's OK for you : 1) the LCDType (enum in line 48 of TextLCD.h) is not used in the "Hello world" example of the Cookbook page : this example works only for the default LCD16x2 type ! 2) when using the LCD20x4 type when calling the TextLCD class, a compilation error is : Identifier "LCD20x4" is undefined (E20).

You should use the identifier as follows:

TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD20x4); rs, e, d0-d3

This works excellent for me.

Posting new comments for this page has been disabled