4D LABS ?LCD-32PT(SGC) 3.2” Serial LCD Display

Hi,

I've got one of the 4D LABS ?LCD-32PT(SGC) 3.2” Serial LCD Display and trying to make use the library that "avenue33" wrote.

I have got an Arduino Mega 1280 connected to the display.

when I upload the code to Arduino, after the display starts up all I can see is the actual screen's splash screen. Nothing else happens!

Anyone any ideas? Experienced the same/similar thing?

Thanks.

Datasheet: http://www.4dsystems.com.au/downloads/Semiconductors/PICASO-SGC/Docs/PICASO-SGC-COMMANDS-SIS-rev8.pdf

You are more likely to get useful responses if you post links to the data sheet for the device and to the library that you used.

Don

First post edited.

Thanks.

Maybe you could ask in his own topic: http://arduino.cc/forum/index.php/topic,60802.30.html

I've been in touch with him.

He suggested I do it this way, as some people may have had the same problem!

If you're seeing the splash screen then it means that it's not seeing the auto baud call. So your serial is not working. You've triple checked that you don't have Rx and Tx swapped right? It can also happen if you send the auto baud call too soon after the screen has started while it's not yet listening to serial commands. If you don't get an ACK from the auto baud call then the screen didn't hear you and you need to send it again.

Do you have an SD card in the display? On their other graphics processor at least certain SD cards can really slow down the startup of the screen, so you may need to change your startup delay.

Tried the code, the same thing.

What is it returning at the end of that sample code, ACK, NAK, or nothing? Without any additional information I can't offer any advice other than what I've already given.

It doesn't return anything! At least not on the display.

The serial monitor returns this:

BBjþ

I don't have a logic analyser!

Sorry! My bad.


init

You're not getting any response from the screen, so either your serial connection is not wired right or you're somehow sending the command too early while the screen is not listening.

Personally, I would change avenue33s wiring just slightly and instead of putting the reset pin of the display to a button, wire it to a digital pin on the arduino, then run this slightly modified test.

#include "NewSoftSerial.h"

#define RESET_PIN               9       //output wired to the reset pin of the LCD screen
#define STARTUP_DELAY      3000  //min 500, max 5000
#define SOFT_RX                  2      // serial receive pin, must be wired to screens TX
#define SOFT_TX                  3      // serial transmit pin, must be wired to screens RX


NewSoftSerial mySerial(SOFT_RX, SOFT_TX);

void setup() {
  pinMode(RESET_PIN, OUTPUT); // setup the reset pin
  digitalWrite(RESET_PIN, LOW); // hold the screen in reset while we finish setting up
  Serial.begin(19200);
  mySerial.begin(9600);

  Serial.print("\n\n\n***\n");
  digitalWrite(RESET_PIN, HIGH); // start the screen up
  delay(STARTUP_DELAY); // wait for the screen to fully initialize

  Serial.println("init \t");
  mySerial.flush();        // clear out the serial read buffer
  mySerial.print('U');    // connect

  unsigned long startTime; // wait only for .5 seconds for a response, then timeout
  bool timedOut=false;
  startTime = millis();
  while (!mySerial.available()) { 
    if (  millis() - startTime >= 500){
      timedOut= true;
      break;
    }
  }

  if(timedOut) {
    Serial.println("Connection timed out!");
    Serial.println("increase STARTUP_DELAY and try again.");
    Serial.println("if increasing delay does not help try reversing the TX and RX pins.");
  }else {
    int returnValue;
    returnValue = mySerial.read();
    if(returnValue == 0x06) {
      Serial.println("Connection sucessful!");
    } else if (returnValue == 0x15) {
      Serial.println("Connection failed!");
      Serial.println("try using a lower serial speed or increasing STARTUP_DELAY");
    } else {
      Serial.print("Unexpected response '");
      Serial.print(returnValue , HEX);
      Serial.println("'");
    }
  }
}
void loop() {
}

I've tried different times and swapped RX with TX, all I get is this:


init
Connection timed out!
increase STARTUP_DELAY and try again.
if increasing delay does not help try reversing the TX and RX pins.

Are you sure you have the SGC and not the GFX version of the screen?

Just about the only other thing that I would think to check would to be a loop back test on the serial port just to be confident that it is working as I assume it is. Connect a wire directly between the TX and RX pins on the arduino, write something to the serial port and then read it back, making sure it's the same at both ends.

You could also try a loop through with your hardware serial port. Set both hard and software serial ports to the same baud rate. Connect TX from the software port to RX of the hardware port. Then write something to the software port and read it back on the hardware port, making sure it's the same. Optionally you can then also write what you read back to the hardware port again and see it echoed on the serial monitor on your computer.

If you have a picture of your wiring perhaps someone might be able to catch something non-obvious that could be causing your trouble, but beyond that it sounds like you've done everything right and you'll probably have to take it up with 4D tech support.

I sent back the display to the place where I got it from, they have tested it and this is the reply they gave me!

"We've tested your module and found it to be in perfect working order. In SGC mode, typing U produces an ACK immediately."

Should I believe them?

Thanks.

Hi,

I asked for my money back and now bought another one from another supplier. I will try that and see what's what.

I have a few Arduino boards. Mega, Uno and Duemilanove. I have tested on all when I had the LCD.

Thanks.

Received the display from the other supplier just now.

Hooked up to the Mega 1280 and same results, then hooked up to UNO and the same results!

Something must be wrong, surely the 2 displays cannot be faulty! Can they?

Yesssssssssssssssssssss

I changed the code and I got this:
"


init
Connection sucessful!
"

Here is the code:

#include "NewSoftSerial.h"

#define RESET_PIN               5       //output wired to the reset pin of the LCD screen
#define STARTUP_DELAY      3000  //min 500, max 5000
#define SOFT_RX                  2      // serial receive pin, must be wired to screens TX
#define SOFT_TX                  3      // serial transmit pin, must be wired to screens RX


void setup() {
  pinMode(RESET_PIN, OUTPUT); // setup the reset pin
  digitalWrite(RESET_PIN, LOW); // hold the screen in reset while we finish setting up
  Serial.begin(19200);
  Serial1.begin(9600);

  Serial.print("\n\n\n***\n");
  digitalWrite(RESET_PIN, HIGH); // start the screen up
  delay(STARTUP_DELAY); // wait for the screen to fully initialize

  Serial.println("init \t");
  Serial1.flush();        // clear out the serial read buffer
  Serial1.print('U');    // connect

  unsigned long startTime; // wait only for .5 seconds for a response, then timeout
  bool timedOut=false;
  startTime = millis();
  while (!Serial1.available()) { 
    if (  millis() - startTime >= 500){
      timedOut= true;
      break;
    }
  }

  if(timedOut) {
    Serial.println("Connection timed out!");
    Serial.println("increase STARTUP_DELAY and try again.");
    Serial.println("if increasing delay does not help try reversing the TX and RX pins.");
  }else {
    int returnValue;
    returnValue = Serial1.read();
    if(returnValue == 0x06) {
      Serial.println("Connection sucessful!");
    } else if (returnValue == 0x15) {
      Serial.println("Connection failed!");
      Serial.println("try using a lower serial speed or increasing STARTUP_DELAY");
    } else {
      Serial.print("Unexpected response '");
      Serial.print(returnValue , HEX);
      Serial.println("'");
    }
  }
}
void loop() {
}

What's the next step?

I got the latest version of the SoftSerial as you said (version 11).

Put it in the libraries folder, and renames the cpp and the h file to NewSoftSerial. Right?

Which one of your libraries should I use?

Thanks.

Thanks, got it working after I asked you :smiley: