Pages: [1]   Go Down
Author Topic: Serial LCD v2.5 with Arduino Uno  (Read 999 times)
0 Members and 1 Guest are viewing this topic.
FL
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the Arduino Uno with SerLCD (3pins), i connect the LCD Vdd to the Uno 5V, GND to GND, and LCD RX to the Uno TX which is at pin digital (PWM (1)). I am using the SoftwareSerial Example, i change the baud rate to 9600. Everytime i upload the code it gave me a bunch of characters as soon as i unplug it and plug i it back i see the right output. Can anyone help please!!!

Code:
/*
  Software serial multple serial test
 
 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.
 
 The circuit:
 * RX is digital pin 2 (connect to TX of other device)
 * TX is digital pin 3 (connect to RX of other device)
 
 created back in the mists of time
 modified 9 Apr 2012
 by Tom Igoe
 based on Mikal Hart's example
 
 This example code is in the public domain.
 
 */
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

void setup() 
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

 
  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


The TX/RX pins are the same as used by the serial port (USB) to upload a new program. You litterly see your program passing by smiley

It is probably better to have the serial LCD disconnected while uploading although I never had trouble with it myself.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use the hardware serial on pins 0 and 1, you will have to disconnect the lcd during program loading, and user hardware serial, not soft.

If you use software serial on other pins, you are free to leave the lcd panel on during programming.
Logged


FL
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem still continue, i moved pin 1 to 3 it didn't work at all. When i change pin 2,3 to 4,5 or to 0,1 it still work the same way; whenever i upload the code its a bunch of characters as so as i unplug the USB and plug it back i get to right output.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

and if you don't unplug usb but press reset ?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2892
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or unplug or disconnect the display before uploading. You can plug it in and then hit the reset button after uploading your sh=ketch.

Bob
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Pages: [1]   Go Up
Jump to: