Sparkfun 20x4 LCD Problem

Sure it’s me doing something wrong but here goes…

Had a Sparkfun 16x2 LCD all set up and working fine. Needed extra screen real estate so bought a 20x4 version.

But aside from the splashscreen on boot I get nothing. Using Newsoftserial.h

I appreciate the code changes for printing to the extra lines but I can’t even print to a single line.

What have I missed?

#include <NewSoftSerial.h>

NewSoftSerial sLCD =  NewSoftSerial(3, 14); /* Serial LCD is connected on pin 14 (Analog input 0) */
#define COMMAND 0xFE
#define CLEAR   0x01
 
void setup() {

  sLCD.begin(9600);             
  sLCD.print(COMMAND,BYTE);
  sLCD.print(CLEAR,BYTE);
  sLCD.print("LCD TEST");
}
 

void loop() {}

Remove the defines and simply try:

sLCD.print(0xFE, BYTE);
sLCD.print(0x01, BYTE);
sLCD.print("Hello World");

Does it work?

Maybe it’s the lack of a space you have after the comma (0xFE, BYTE)

Mowcius

Tried your suggestion and no joy :(

Exchanging the 20x4 for the 16x2 and it all works.

The splash screen is displayed so I presume the LCD itself is OK.

I can see the backlight go off/on as the sketch is uploaded but nothing on the display?

Try sending a reset command. I can't remember what it is but it's in the datasheet. Maybe the baud rate is wrong...

Mowcius

The data sheets says:

If the Serial LCD gets into an unknown state etc etc, enter “r” at 9600 baud whilst the splash screen is active and the unit will reset to 9600 baud.

How would I send those commands via an Arduino?

Similarly it says to change/set the baud rate enter 0x7C, then “m”.

Sorry for all the newbie questions, I’ve started from scratch and am getting there slowly!

Right, I suggest loading up an arduino sketch like so:

void resetLCD(); 

void setup() 
{ 
Serial.begin(9600);
} 

void loop() 
{ 
delay(1000); 
resetLCD(); 
}

void resetLCD() { 
Serial.print(0x07, BYTE); 
Serial.print(18, BYTE); 
}

Load that onto your arduino with the LCD diconnected. Unplug from the computer, plug in your LCD to the hardware serial port and then power it up using an external supply.

Have a play around with that and see if it sorts it.

Mowcius

Arrrgh, starting to annoy me now. No joy with those commands sadly.

Found a few other suggestions but no idea if it is the display is duff or I'm just not doing this correctly :-/

Well if none of that worked then I would say that the display is duff.

I can't think of anything else...

If you have an FTDI header then you could try sending commands at 9600 baud to it directly from your computer but I highly doubt that would make a difference.

Mowcius

Thanks for taking the time to help. At least I now know how to send some of the config commands to the Serial LCDs now!

I'll take this up with the supplier. I normally buy from the established suppliers but took a chance and bought this from eBay. We'll have to see now if I get any support!

Try and use 4800 baud instead. It is known some units has a default baudrate of 4800.

So change it to:

void setup() { sLCD.begin(4800);

Also check your Tx and Rx line are wired up correctly.


Arduino supplies from the UK www.skpang.co.uk/catalog

Thanks, gave it a shot (and tried all the other baud rates too) but no joy.

Strangely though, now when I upload the sketch I was using to test, I can see the backlight flickering rapidly. It wasn't doing that before.

I'd have bought from you but you don't stock a 20x4 LCD :(

Well the joys of ebay have shown themselves again...

Ebay can be great but it's not always very easy to get through to the sellers when something does not work out quite how it should. :(

Mowcius

The seller has responded and said they'll be in touch tomorrow. They stock a large number of Arduino items, Sparkfun etc and I don't think they're a fly by night seller, 100% feedback etc.

Given it's the weekend I guess it's a little unfair of me to jump to conclusions and pre-judge the outcome just yet.

In this case I didn't buy because they were cheaper than an established seller, I chose them simply because they were the only ones who stocked a Sparkfun 20x4 Serial LCD that I could find and who were able to ship that day.

I'll keep y'all updated. In the meantime I'm back to debugging Canbus!

The seller has responded and said they'll be in touch tomorrow. They stock a large number of Arduino items, Sparkfun etc and I don't think they're a fly by night seller, 100% feedback etc.

Given it's the weekend I guess it's a little unfair of me to jump to conclusions and pre-judge the outcome just yet.

In this case I didn't buy because they were cheaper than an established seller, I chose them simply because they were the only ones who stocked a Sparkfun 20x4 Serial LCD that I could find and who were able to ship that day.

Good to hear :) That is a good thing about the feedback stuff. It makes sellers be the best they can be.

Mowcius

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 abd bu**er me 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 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?

Maybe it sent 16x2 specific commands (no that doesn't make sense)

What is the shield?

Images? Schematic?

Mowcius

It's the SKPang Canbus Shield. I'm going to re-test with a 9v PSU or the LiPo Vackpack and see if it is simply a power draw issue.

When I connected directly to the Arduino I was using the same pins as are passed through to the connector on the shield so it has to be a power issue I think.

Hmm, interesting. Yeah...

As I've just solved the problem I thought I'd post back to bring closure!

I was in a lengthy discussion over on Sparkfun's forum and it had everyone there just as baffled.

In the end I discovered the cause whilst measuring the voltages in various configurations and its both obvious and annoying at the same time.

For reasons known only to Sparkfun, the JST connectors on the 16x2 and 20x4 are configured differently! I was using the cable I had with the 16x2 and so when I used that on the 20x4 it was transposing VDD and Rx pins >:(

?
Huh?
Why?

Well at least you sorted it :stuck_out_tongue:

Mowcius