SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By vitoAM
#79029
Hi, I was playing with serial LCD than I´ve send a bad command, the LCD lost it´s back light than it does not receive correct characters at any baud rate :/

I´ve disabled the splat screen so the boot is too fast for sending a control r for reset, i´ve try it with no sucess

Is there any way of get this ser LCD to default values?

Tanks
By rst26508
#80019
Did you find out how to reset the Serial LCD? I seem to have got mine into a state where whatever I print is garbeled. The splash screen is still at the default but I can't seem to get the timing right for the reset commands.
By rst26508
#80022
I sorted my LCD problem out.
I set up a sketch with the reset code in the main loop with a delay of 100 between loops. I had the ground wire to the LCD disconnected when I powered up the ardunio then connected it. I wonder if similar would work for you (maybe with a shorter loop).

I might need to put in a switch to take the LCD out of circuit for upload's, disconnecting wires is a pain.
By zada-tech
#80601
I have a problem with my serial BackPack connected to my 16x2 LCD!

When I connect it to Arduino the splash screen comes up and stays for longer than 500ms!

Also none of what I've loaded into Arduino gets shown!

Here is my code:
void setup()
{
Serial.begin(9600);
backlightOn();
}

void loop()
{
selectLineOne();
delay(100);
Serial.print("Hi");
}

void selectLineOne(){
Serial.print(0xFE, BYTE);
Serial.print(128, BYTE);
}

void backlightOn(){
Serial.print(0x7C, BYTE);
Serial.print(157, BYTE);
}


What is the problem?

I also disconnect the RX from the TX of the Arduino when uploading things to Arduino.

Any help is appreciated.

M.
By rst26508
#81161
I used this to get mine cleared. I don't know if there is a more elegant solution but it worked.

// Reset a SparkFun Serial LCD (16*2)
// Bob Stephens 03/06/2009
// -------------------------------------------------------------------------------

void resetLCD();
void setSplash();


// --------------------------------------------------------
void setup()
{
// start serial port
Serial.begin(9600); // open serial
// setSplash();
}

// --------------------------------------------------------
void loop()
{
resetLCD();
}

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

void setSplash() {
clearLCD();
goTo(3);
Serial.print("Some text");
goTo(17);
Serial.print("Second line");
delay(100);
Serial.print(0x7C, BYTE);
Serial.print(10, BYTE);
delay(5000);
clearLCD();
}
By zada-tech
#81170
rst26508, I used your code, but no luck! I still get the Sparkfun default splash screen!!!!

Don't know what to do anymore!

Here is my code:

-------------------------------------------------
void resetLCD();
void setSplash();


// --------------------------------------------------------
void setup()
{
// start serial port
Serial.begin(9600); // open serial
// setSplash();
}

// --------------------------------------------------------
void loop()
{
resetLCD();
}

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

void clearLCD()
{
Serial.print(0xFE, BYTE);
Serial.print(0x01, BYTE);
}

void goTo(int position)
{ //position = line 1: 0-15, line 2: 16-31, 31+ defaults back to 0
if (position<16){ Serial.print(0xFE, BYTE); //command flag
Serial.print((position+128), BYTE); //position
}else if (position<32){Serial.print(0xFE, BYTE); //command flag
Serial.print((position+48+128), BYTE); //position
} else { goTo(0); }
}


void setSplash() {
clearLCD();
goTo(3);
Serial.print("Some text");
goTo(17);
Serial.print("Second line");
delay(100);
Serial.print(0x7C, BYTE);
Serial.print(10, BYTE);
delay(5000);
clearLCD();
}
-------------------------------------------------
By rst26508
#81207
zada-tech that code sample is set up to reset defaults. I've commented out the command to set the splash. I doubt that seting up the splash will work with reseting defaults happening. I don't recall the timing rules for setting the splash screen, I think that it can happen any time but have not checked lately.

Comment out the resetLCD comment and remove the comments from the setSlash call and see what happens. I did a bit of fiddling to get my screen reset and to set my splash screen and my recollection of the sequence is a bit hazy. To unscrample the screen I think I powered up the Arduino then the LCD as the reset command needs to be run while the splash is on screen (I think).

// --------------------------------------------------------
void setup()
{
// start serial port
Serial.begin(9600); // open serial
setSplash();
}

// --------------------------------------------------------
void loop()
{
delay(1000);
// resetLCD();
}
By chorob
#81288
rst26508, Thank You!

I thought I had a $25 paper weight. It works!

I just commented out the splash screen settings portion of the code and it recovered. Thanks again.
By Talada
#95505
My SerLCD was also showing scrambled text and dimmed. This is caused by leaving GND
connected while the Arduino or whatever microcontroller you use connected.

I managed to reset my SerLCD using this code. I understand that a resolution has already been made, but I clarified a little more here I think... good luck tinkering!
Code: Select all
//SerLCD FIX v0.1 by Talada
/*Upload with SerLCD attached. Once running, start Serial
  Monitor. Follow instructions in Serial Monitor.*/
  
void setup(){
  Serial.begin(9600);  //Begin serial communication.
}

void lcdReset(){               //New Function
  Serial.print(0xFE, BYTE);  //Command code
  Serial.print(0x72, BYTE);  //Reset code
}

void cls(){                       //New Function
  Serial.print(0xFE, BYTE);  //Command Code
  Serial.print(0x01, BYTE);  //Clear Screen Code
}

void loop(){
  Serial.print("Attach GND now");     //Note: You can attach the GND while Reset is being sent
  delay(1000);
   
     for (int repeater=0; repeater <= 15; repeater++){    //sends Reset Command 15 times
          lcdReset();
          delay(500);
         } 

  cls();
  Serial.print("LCD Reset! Remove GND");    //You have 21 seconds to remove GND before Reset is sent again.
  delay(20000);
  
}
Hope this helps!
By henrikp
#123872
Hello,
got this backpack recently as well, managed to get things working but one thing bugs me - whenever I upload a sketch/reset the arduino via the reset board WHILE TX pin connected it confuses the backpack (e.g. blank screen usually and nothing gets written with Serial.print) and I need to
a) disconnect the ground or +5V line for some seconds or
b) power cycle the whole arduino unit.
When resetting or uploading the sketch TX unplugged everything goes well.

My question: is there a way to reinitialize the serial backpacks main loop via software? The datasheet doesn't say anything similar, neither the latest source code for the backpack.
By Chagrin
#124070
A simple solution is to use the SoftwareSerial library and avoid the RX/TX pins, thus no garbage reaching the SerLCD during program upload.
By henrikp
#124083
Chagrin wrote:A simple solution is to use the SoftwareSerial library and avoid the RX/TX pins, thus no garbage reaching the SerLCD during program upload.
Thanks a bunch. I must have been blind to miss that suggestion on the Arduino reference page. That fixes the reset problem. Currently it seems that I have to power cycle the LCD after each 0x7C+next byte sent (for example enabling the backlight), the screen goes blank and stays that way. Is that normal behaviour?
EDIT: The value gets changed in the EEPROM, but the "hanging" bugs me.
By JChristensen
#124102
henrikp wrote:Currently it seems that I have to power cycle the LCD after each 0x7C+next byte sent (for example enabling the backlight), the screen goes blank and stays that way. Is that normal behaviour?
Evidently is normal. Try delay(5) after changing the backlight.