|
|
Western New York, USA
Online
Faraday Member
Karma: 17
Posts: 3457
|
 |
« Reply #1 on: March 09, 2012, 10:25:14 am » |
We ran into this exact same problem a few weeks ago. Check this out (specifically Reply #4): http://arduino.cc/forum/index.php/topic,89611.0.htmlDon
|
|
|
|
« Last Edit: March 09, 2012, 10:27:02 am by floresta »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 44
|
 |
« Reply #2 on: March 09, 2012, 11:54:23 am » |
Thanks. I had a feeling this may be the case :/
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #3 on: March 09, 2012, 01:44:02 pm » |
Hi, I just scanned at your LCD's data sheet & noticed a couple of things you may want to check since I think it's very unlikely your new lcd's controller is faulty. 1. There is an initialization step on page 6 where the number or rows & cols are set. So have you done this properly in your in lcd.begin() - refer to http://arduino.cc/en/Reference/LiquidCrystalBegin2. The set CG ram address & set DD ram address commands on page 5 of your controller's data sheet seem to need 6 data bits. This possibly means that you may need to use the 8 data lines mode to be able to access your whole display. Try connecting with 8 data lines from arduino to the LCD as explained in the reference http://arduino.cc/en/Reference/LiquidCrystalConstructorRegards Srinath
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Online
Faraday Member
Karma: 17
Posts: 3457
|
 |
« Reply #4 on: March 09, 2012, 01:51:36 pm » |
Hi, I just scanned at your LCD's data sheet & noticed a couple of things you may want to check since I think it's very unlikely your new lcd's controller is faulty. 1. There is an initialization step on page 6 where the number or rows & cols are set. So have you done this properly in your in lcd.begin() - refer to http://arduino.cc/en/Reference/LiquidCrystalBegin2. The set CG ram address & set DD ram address commands on page 5 of your controller's data sheet seem to need 6 data bits. This possibly means that you may need to use the 8 data lines mode to be able to access your whole display. Try connecting with 8 data lines from arduino to the LCD as explained in the reference http://arduino.cc/en/Reference/LiquidCrystalConstructorRegards Srinath Sorry - neither of these guesses are valid. (1) He would not be getting the '22' on the screen if the display were not set for two rows of memory. (2) All commands and all display data require 8 bits. The interface mode, 4-bit or 8-bit, is irrelevant. Did you look at the link I provided in my original reply?Don
|
|
|
|
« Last Edit: March 09, 2012, 01:57:04 pm by floresta »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #5 on: March 09, 2012, 02:17:50 pm » |
Hmmmm... Ok got it... Obviously a casual perusal of the datasheet is probably not good enough :-)
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 44
|
 |
« Reply #6 on: March 09, 2012, 02:20:53 pm » |
For what it's worth, I did indeed try the display with the 8bit interface as well.
Is it perhaps possible I damaged the controllers by (as embarassing as it is) connecting the +5v and the GND the wrong way around initially? :/
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Online
Faraday Member
Karma: 17
Posts: 3457
|
 |
« Reply #7 on: March 09, 2012, 02:49:25 pm » |
Is it perhaps possible I damaged the controllers by (as embarassing as it is) connecting the +5v and the GND the wrong way around initially? :/ That's possible but I would think that the main controller would have been damaged as well. Have you checked the board for breaks in the traces and have you tried to apply pressure to the glass?
You could always use some masking tape and call it an 8x2 display.Don
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25416
Solder is electric glue
|
 |
« Reply #8 on: March 12, 2012, 09:17:26 am » |
Just try printing a long string in place of hello world, you will probbly find that letters appear later on in the string. Most of these LCD displays are not contiguous when used with the LCD libary. That is the 16 th letter in the string may well appere in the 9th position on the display, or some such combination. This is what I always find when using the libary anyway.
|
|
|
|
|
Logged
|
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5915
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #9 on: March 12, 2012, 03:39:52 pm » |
Post your code. I guess you used the right code but it's worth posting and getting checked for mistakes.
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Online
Faraday Member
Karma: 17
Posts: 3457
|
 |
« Reply #10 on: March 12, 2012, 04:42:19 pm » |
Just try printing a long string in place of hello world, you will probbly find that letters appear later on in the string. Here's how to do the first part (try printing a long string):#include <LiquidCrystal.h>
//LiquidCrystal lcd(rs,en,d4,d5,d6,d7); LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // put your pin numbers here
void setup() { lcd.begin(20, 4); // this will work for all displays except some rare 16x1's for (char i=47; i<127; i++) // send 80 consecutive displayable characters to the LCD { lcd.print(i); delay(100); // this delay allows you to observe the addressing sequence } }
void loop() { } I don't agree with the second part (you will probbly find that letters appear later on in the string).
I think you will probably see characters in 16 locations and blocks in the rest of the locations.Don
|
|
|
|
« Last Edit: March 12, 2012, 04:44:09 pm by floresta »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 44
|
 |
« Reply #11 on: March 15, 2012, 04:23:01 am » |
Ordered a new one, unplugged old one, plugged in new one and the same code works perfectly.
The display was indeed faulty.
|
|
|
|
|
Logged
|
|
|
|
|
|