10 Questions You Should to Know about uart lcd display
Trying to understand LCD... - Displays - Arduino Forum
Greetings, all. This is my 1st post here and I am a noobie to the arduino world. I'm using an Uno and Arduino IDE 1.0.1.
If you want to learn more, please visit our website ORIC Electronics.
I have recently purchased a 4 x 20 LCD from jameco.com.
Product Link: http://www.jameco.com/webapp/wcs/stores/servlet/Product____-1
A link to the data sheet for the product is available there as well. However, because I am a noob, there is much on the data sheet I simply don't understand.
I'm having difficulty understanding the pin outs of the device and exactly how this thing can hook up to the Arduino and get stable results. I have spent some time soldering short solid-wire jumpers to the LCD board so it can be plugged into a breadboard, and I'm using flexible jumper wires to connect the display from the breadboard to the Arduino. At this point, I am using the 5v Power, Ground, and the TX out from the Arduino (connected to the RS232 Serial In of the display).
The display lights up and displays characters. However, none of the LCD sample libraries/code for Arduino seem to work. They look to me like they're using a parallel LCD... This one is a serial LCD. All I can get on the display is random characters (garbage).
Also, according to the data sheet for the product, it is capable of I2C. If someone could instruct me on how to utilize this display that way it would be greatly appreciated.
Thanks to all of you for any help.
grpace
To floresta...
You make a good point. A bit brash I might say, but a good point just the same.select
Hopefully, the following photo links will work and help...
The display on the breadboard:
http://grpace.net/arduino/photos/lcd/Breadboard1.png
There are 2 sets of solder points. According to the spec sheet (from left to right):
- RX | RS232 In
- VSS | Ground
- VDD | 5v for logic
- SPISS| SPI Slave Select
- SDO | No Connect
- SCK/SCL | Serial Clock
- SDI/SDA | Serial Data In [SPI] / Serial Data [I2C]
- VSS | Ground
- VDD | 5v for logicselect
As you should be able to see in the photo, I have the two 5v and Grounds jumpered together on the breadboard.
A "top view" of it is here: http://grpace.net/arduino/photos/lcd/Breadboard2.png. Sorry... Couldn't get a clearer photo.
The color coding used on the wires:
Red = 5 volt
Grey = Ground
Yellow = Data In (both RS232 and SPI/I2C connections)
Blue = Serial Clock
Purple = SPI Slave Select
Now...
Using flexible jumper wires, I have 5v and Ground from the Arduino to the 5v and Grounds that are jumpered together on the breadboard.
I am also jumpering digital pin 3 on the Arduino to the RS232 Serial In (the display's RX pin) on the breadboard.
I am also attempting to use the Arduino's example SoftwareSerial library code to communicate with the display.
It seems to be displaying, but with some garbage characters thrown on the display, as can be seen here:
http://grpace.net/arduino/photos/lcd/Display.png
I hope I have explained all of this well. I really would appreciate any help in understanding what's happening here. If anyone needs further clarification, please feel free to ask.
Thank all of you in advance !
grpace
It is a good lcd, much better than the typical one with a dumb io expanders.
There is a trade off to consider when choosing between the intelligent and the dumb I/O expanders.
The intelligent ones are much easier to use but you are at the mercy of the person who did the programming. If they have implemented all of the LCD controller capabilities that you want to use and if they have not crippled any of the capabilities that you want to use, then the microprocessor based implementations are probably better.
If you go with the dumb variety then you are responsible for all of the coding and your host microprocessor has more work to do but you do have more control over the implementation of the inherent capabilities of the LCD controller.
Don
Wow !! Thanks to all of you folks for your input !!
OK... Here's the code I'm trying:
/*
Code to test a serial 4x20 LCD display using Arduino Uno
A modified version of the SoftwareSerial example included with the Arduino IDE
------------------------------------------------------------------------------
From the original example:
Software serial multple serial test
Receives from the hardware serial, sends to software serial.
Receives from software serial, sends to hardware serial.
The circuit:
* RX is digital pin 2 (connect to TX of other device)
* TX is digital pin 3 (connect to RX of other device)
created back in the mists of time
modified 9 Apr
by Tom Igoe
based on Mikal Hart's example
This example code is in the public domain.
-----------------------------------------------------------------------------
*/
boolean debug = true;
#include
SoftwareSerial lcd(2, 3); // RX, TX
void setup() {
if (debug) {
Serial.begin();
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("LCD Test");
}
// set the data rate for the LCD's SoftwareSerial port
lcd.begin();
delay(100); // data sheet states 100mS is required upon power-up for the display's controller to initialize
lcdClearDisplay();
lcdBlinkingCursorOn();
if (debug) { // show the display's current status
lcdReportSelf();
}
lcdClearDisplay();
lcd.write("\nHello, world !! "); // drops the "H" without the \n in front of the character string. Why ??
lcd.write("Line2"); // completely skips the 2nd line of the display
lcdSetCursor(0); // displays garbage instead of repositioning the cursor
}
void loop() {
}
////////////////////////////////////////////////////////////////////////////
// LCD Command Set
//--------------------------------------------------------------------------
// Specific to: New Haven Serial LCD Display, 4x20
// Manufacturer Part Number: NHD-D3Z-FL-GBW-V3
//--------------------------------------------------------------------------
void lcdReportSelf() {
lcdDisplayFirmwareVersion(); delay();
lcdDisplayBaudRate(); delay();
lcdDisplayI2CAddress(); delay();
}
void lcdDisplayOn() { lcd.write(254); lcd.write(65); }
void lcdDisplayOff() { lcd.write(254); lcd.write(66); }
void lcdSetCursor(byte position) { lcd.write(254); lcd.write(95); lcd.write(position); }
void lcdCursorHome() { lcd.write(254); lcd.write(70); }
void lcdUnderlineCursorOn() { lcd.write(254); lcd.write(71); }
void lcdUnderlineCursorOff() { lcd.write(254); lcd.write(72); }
void lcdCursorLeft() { lcd.write(254); lcd.write(73); }
void lcdCursorRight() { lcd.write(254); lcd.write(74); }
void lcdBlinkingCursorOn() { lcd.write(254); lcd.write(75); }
void lcdBlinkingCursorOff() { lcd.write(254); lcd.write(76); }
void lcdBackspace() { lcd.write(254); lcd.write(78); }
void lcdClearDisplay() { lcd.write(254); lcd.write(81); }
void lcdSetContrast(byte value) { lcd.write(254); lcd.write(82); lcd.write(value); }
void lcdSetBacklightBrightness(byte value) { lcd.write(254); lcd.write(83); lcd.write(value); }
void lcdMoveDisplayLeft() { lcd.write(254); lcd.write(85); }
void lcdMoveDisplayRight() { lcd.write(254); lcd.write(86); }
void lcdChangeBaudRate(byte newbaudrate) { lcd.write(254); lcd.write(97); lcd.write(newbaudrate); }
void lcdChangeI2CAddress(byte newaddress) { lcd.write(254); lcd.write(98); lcd.write(newaddress); }
void lcdDisplayFirmwareVersion() { lcd.write(254); lcd.write(112); }
void lcdDisplayBaudRate() { lcd.write(254); lcd.write(113); }
void lcdDisplayI2CAddress() { lcd.write(254); lcd.write(114); }
Also, as an added befit to debugging this thing...
A short video of the code/display in action is here:
http://grpace.net/arduino/photos/lcd/lcd.DebugDemo.AVI
If you'll kindly notice, the second line of the display is being completely skipped. Also, the || at the end is being generated by trying to reposition the cursor (see the code). I have triple-checked the command set on the data sheet and tried to make sure I'm sending the correct command sequence.
I'm sure it's likely something simple I'm missing, but I haven't been able to put my finger on it.
Again...
THANK ALL OF YOU FOR YOUR RESPONSES !!
grpace
- you probably want to observe the timing requirement specified in the datasheet.
This is what is causing your missing character after the 'Clear screen'.
- you will need to move cursor to the 2nd line first in order to "print" to that line.
And, since they don't seem to have implemented the 'Set DDRAM Address' capability of the LCD controller (unless I missed it), you are going to have to calculate how many times you must use the 'Move the cursor right one place' command to get where you want to go.
You might want to follow the LCD Addressing link at http://web.alfredstate.edu/weimandn for some background information on this task. Make sure you read the 40x2 stuff before you go to the 20x4 information.
Running a program that displays a string of 80 consecutive displayable characters, with a short delay between each, will help you follow what is going on.
Don
EDIT: I missed it. You need to use the 'Set cursor' command. The information at the link I posted should still be of value. I will take another look in the morning but right now I think the information in the table on page 9 of the New Haven datasheet is a bit messed up.
I'm happy to report that all things seem to be working well, now !!
Special thanks to all that have replied:
billroy, dhenry and most of all, floresta (don).
[Virtual handshake going on here] !!
To dhenry:
Thank you for pointing out the timing to me. Changes have been incorporated into the code.
Don, If you hadn't pointed me to the information you did, it would have taken me days to study/understand what was actually going on! The information is invaluable. And you are right about page 9 of the Data Sheet... Unless my conversions are wrong, 0x00 to 0xFF is only 16 characters. They have the Line1 and Line2 "line span" incorrect on the Data Sheet.
Now, addressing the garbage that was being displayed...
MY FAULT !! I inadvertently hit the wrong key on the calculator when doing the HEX to DEC conversion. I corrected that, and the garbage went away ! The lcdSetCursor() function now works as it should.
I'll be adding a few functions to the LCD code to be able to clear / print to specific lines on the display. When it all works I will post the function package for this particular LCD here for anyone to have and use.
Again, thanks to all of you !!
Help like this is why I LOVE Open Source stuff !!!
grpace
Yes, Don, I may have shot myself in the foot there a little.
There is still something I'm not understanding on the Data Sheet...
Specifically page 4 of the Date Sheet...
How to switch this display into it's different possible modes.
The Data Sheet describes jumper combinations between R1 and R2, but I have no clue as to what they are referring to.
If you wouldn't mind revisiting the photos/video I posted earlier...
Is that that 2 solder points on the right side of the display's board ???
The Data Sheet doesn't make this clear.
And... by the way...
This display will eat a 9v battery fast !
Even when the Uno is connected to the USB, it dims out after a couple of minutes.
Correction...
Fully charged 9v battery... display is bright and clear.
10 minutes of use... Text on the display dims out and is unreadable.
Put a meter on the battery... 8.62 volts.
The Data Sheet states it should run on 5 volts.
grpace
LCD interface questions? SPI? Graphic interface?
Hey, me and my friend were able to finish the to record and transmit accurate data using UART. However, Now I'm focusing generating the waveform on a Velleman VMA412 LCD. I posted a question regarding what LCD screen to get, and most of the people on here recommended an Ili LCD display. This VMA412 display I'm using has the Ili V0.7. I was given a schematic by Motoo Tanaka that utilized SPI interface (All credit goes to him, Thank you!). However, I believe that my SPI on my LCD seems to only have SD Cards SPI protocols and not a separate pin to connect to the Master SPI Component in PSOC (I think this is due to the SD before each SPI protocol pin). I will show a picture of the LCD pins plus the data sheet of LCD . But I connected DS_SCK to the master sclk, MOSI to SD_DI, MISO to SD_DO, I think I connected TFT_CS to LCD_CS. connected VDD and ground. The LCD turns on, I just get a white screen though. And the other pins on my schematic I still have questions about, As I have no clue to where they go? I looked at the Ili Datasheet but it is 300 pages and I don't think this LCD screen has the same layout as it. Pins IM[0-3] for interface mode are missing! If SPI does not work, I was offered another suggestion by DheerajK to use the GraphicsLCDInt component. However, I think I need to download Segger Emwin library to be able to utlize the 8 bit communication component. I would also like tips on that! As a last resort. I found a Russian website that featured plenty of examples of Graphic LCD. However, Google translate was not much help and I'm not fluent in Russian.
For more uart lcd displayinformation, please contact us. We will provide professional answers.
Thank You! and any help will be appreciated as you all have been of great help!
Here is the link to the product!
https://www.jameco.com/z/VMA412-Velleman-2-8-320x240-Touchscreen-Display-for-Arduino-Boards_....
Credit Goes to Motoo Tanaka for the Schematic, TFT.h and TFT.C!
Solved! Go to Solution.
1 SolutionThe forum had such projects.
This project is similar to yours:
http://www.cypress.com/forum/psoc-5-known-problems-and-solutions/lcd-tft-32-ili-use-mode-16-bit-...
I hope someone will tell you where there is more.
View solution in original post
10 Replies All replies Accepted solutionI found little information on this display.
It seems impossible to choose an interface.
a few questions:
- Does the display require 2 sources of 3.3 and 5 volts?
- do you use GraphicLCDIntf (8bit) to connect?
this is my website
Before Using Segger Emwin library
you need to make sure that you have a connection with the display:
- use GraphicLCDIntf (8bit) to connect
- conduct a simple communication test, for example, read the display ID.
- Learn how to initialize the display.
I ordered another LCD display that should have an SPI Interface. I'm not really fond of using Segger Emwin. It seems time consuming and convoluted, albeit really fun to play with once I know the library. The LCD turns on when I connect it to 5V and ground. I don't think I need the 3.3 V, It might be an important pin. But it may be for analog or Back Light I'm not sure. I thought I need to download Segger EmWin to use GraphicLCDintf8 bit? As I need the initialize library to even interface with the LCD screen (To ensure I receive and write data in 8 bit parallel). I can turn on it on but I have no clue on how to initialize or transmit data. I purchased another SPI compatible LCD screen. However, I was wondering I also would like to port the data to MATLAB Also through UART. As working with a graphic LCD seems a little bit outside my knowledge right know, just as a back up.
It seems the display should be connected as in the figure below.
I hope this is a standard Ili display, prepared for connection to an arduino, therefore, you can use the initialization for this display.
If you plan to create a project with VMA412 publish it here to make it easier to discuss problems.
The simplest thing is to read the display driver ID:
send the command 0xD3h and read the data 4 times
in the last two reads it should return the driver ID ().
The forum had such projects.
This project is similar to yours:
http://www.cypress.com/forum/psoc-5-known-problems-and-solutions/lcd-tft-32-ili-use-mode-16-bit-...
I hope someone will tell you where there is more.
Hey! thanks for the help! I also obtained this LCD screen from this website to make my life a little bit easier, and use an SPI library.
2.8 inch ili 240x320 spi tft lcd display touch panel spi serial port module Sale - Banggood.com
This one has an SPI connection. I was wondering as I'm still knew to LCD displays. If I connect all these pins to the schematic on This board.
and connect them properly using the SPI schematic above. And I still just get a blank white screen. What does that mean? I also have no clue where the LED pin connects to I think it is the backlight? but When I connect VCC and GND I still get no power. But when I connect LED and GND I Get a white light!. Thanks again for the help!
and here is the PIN Schematic.
My display connection diagram is attached.
Tell me what kit you are using.
If you publish your project, I can check it out with my display.
Eugeniy
p.s. https://community.cypress.com/message/#
Attachments are accessible only for community members.I'm using Psoc 5lp as the kit!
and here is the project!
Thanks for the help. I'm not doing a 3.3 Voltage divider for some of the pins you mentioned for the pictures above. Maybe that might be an issue.
3.3V power via red LED.
For 5V - a white screen.
I think that I used some large (~200OHm) resistor in series with 5V with same screen to drop down voltage to ~3V.
/odissey1
The company is the world’s best epaper display supplier. We are your one-stop shop for all needs. Our staff are highly-specialized and will help you find the product you need.
- Previous: None
- Next: The Ultimate Buyer's Guide for Purchasing 0 95 inch amoled display