SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By DarrenG
#100943
Hi guys.

Bought a 20x4 Serial LCD yesterday to replace a 16x2 in a small Arduino project of mine but I'm not able to get anything out of the display.

All of this works with the 16x2.

I see the splash screen so I know the display works and I can see the backlight come one when a sketch is uploaded. However, when I send print commands nothing is displayed.

I'm using the very simple sketch below to try and debug the issue. I have considered a reset of the display as per the datasheet but being new to much of this I'm a little confused as to how I should enter the provided reset commands when its hooked up via an Arduino board.

Any help appreciated. Got a bunch of Sparkfun stuff, proto-board, danger shield, RTC and two serial LCDs and this is the first one that has me stumped!
Code: Select all
#include <NewSoftSerial.h>

NewSoftSerial sLCD =  NewSoftSerial(3, 14); /* Serial LCD is connected on pin 14 (Analog input 0) */
 
void setup() {
  sLCD.begin(9600);              /* Setup serial LCD and clear the screen */
  sLCD.print(0xFE, BYTE);
  sLCD.print(0x01, BYTE);
  sLCD.print("Hello");
}
 
void loop() {}
By DarrenG
#101300
Well after sending the LCD back and the supplier having confirmed it as working properly I received it back this morning and still no go.

The LCD is plugged into a shield so I removed the shield and connected directly to the Arduino and it works fine!

Now I did try this before I sent it back but must have done something wrong (you'd think with only three wires it would be hard to mess up eh!) as it didn't work. So now I have a working LCD and it must be the shield that is the problem.

The shield functions as a GPS shield and custom Canbus OBDII interface. It has a 3-pin connector for a Serial LCD and works fine with the 16x2. So what could be wrong that causes the LCD not to function via the shield but OK directly connected whereas the 16x2 is fine, voltage drop perhaps?

Does the 20x4 have much higher demand than the 16x2?
By SFE-Robert
#101306
It seems like your shield and LCD are sharing pins. Is that the case? If the LCD works alone with the Arduino, and the shield works alone with the Arduino, there's something in your software that's wonky, or you are sharing pins on the Arduino.
By DarrenG
#101307
The shield is a commercial one, designed to interface with OBDII in a vehicle and output the data to a serial LCD via an on-board 3-pin socket for the LCD.

The weird thing is, as I've said, everything works fine with Sparkfun 16x2 Serial LCD, but not with the 20x4 :?

When the 20x4 is plugged in via the shield the splash screen message is lighter and the backlight not as bright and no text appears. Plug the 16x2 in and it displays the text.

When the 20x4 is plugged into an Arduino directly all is fine.

Very confusing!
By SFE-Robert
#101314
Maybe that shield is either shorting or drawing too much current? Maybe you will need to power something separately. If the LCD works fine with the Arduino, it's some sort of interfacing issue.
By esklar81
#101325
DarrenG,

Measuring current is usually more of a challenge than is measuring voltage. I believe one could get a good idea of what's happening by monitoring the voltage on the power pin to the LCD module in the various phases of operation.

If that voltage is sagging substantially, I suggest you try to supply power to the LCD module through a different path.

Eric
By DarrenG
#101329
I'll try and measure the voltage as you suggest.

I've been experimenting with various different modes to try and establish the cause of this but am now more confused than ever!

If I power the LCD from an external 5v LiPo Arduino Backpack (http://www.liquidware.com/) but with the Rx pin connected to A0 as it is via the shield I get a string of vertical lines filling the display as soon as I supply power.

Connect the LCD to the shield A0, 5V, GND as normal and the basic test sketch I posted at the beginning of this thread works.

If I connect the LCD via the shield and supplement it with 5v power and GND to JP4 on the LCD I get nothing at all.

Very very odd indeed!
By esklar81
#101330
DarrenG wrote:I'll try and measure the voltage as you suggest.
I suggest doing that for each of the power configurations, but not without addressing the ground reference concern. It is important that, regardless of the configuration you're using, all of the pieces agree as to what 0 V is. You need to connect the grounds of the Arduino, display, shield, and power source together.
DarrenG wrote: If I power the LCD from an external 5v LiPo Arduino Backpack (http://www.liquidware.com/) but with the Rx pin connected to A0 as it is via the shield I get a string of vertical lines filling the display as soon as I supply power.
Possibly a ground reference problem. Although Pin 14 may well be suitable for this use, the output pin needs to be a Digital Output, doesn't it? Have you assigned the proper pinMode to it?
DarrenG wrote:Connect the LCD to the shield A0, 5V, GND as normal and the basic test sketch I posted at the beginning of this thread works.
I'm confused! I thought that's the configuration that does not work.
DarrenG wrote:If I connect the LCD via the shield and supplement it with 5v power and GND to JP4 on the LCD I get nothing at all.
Sound like a lack of common ground to me.
DarrenG wrote:Very very odd indeed!
How else would we have so much fun? :wink:

Happy Hunting,
Eric
By DarrenG
#101333
esklar81 wrote:It is important that, regardless of the configuration you're using, all of the pieces agree as to what 0 V is. You need to connect the grounds of the Arduino, display, shield, and power source together.
Ah that makes sense, thank you!
Possibly a ground reference problem. Although Pin 14 may well be suitable for this use, the output pin needs to be a Digital Output, doesn't it? Have you assigned the proper pinMode to it?
You've got me there, I'm just working with the sketch that I was suggested to me (in my opening post) as a very simple test sketch. It works for the 16x2 sLCD. I'm using the same pin with/without the shield to avoid mistakes. I'm guessing A0 is configured as a digital pin by the line:
Code: Select all
NewSoftSerial sLCD =  NewSoftSerial(3, 14); /* Serial LCD is connected on pin 14 (Analog input 0) */
I'm confused! I thought that's the configuration that does not work.
My apologies, I meant connected to Arduino directly, sorry!
How else would we have so much fun? :wink:
How very true. If it all worked out of the boxes I'd know a lot less about the ins & outs of the LCD and a raft of other bits that I'm learning along the way.

Appreciate your input here, I will try this again with common grounds and report back.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]