new serial 2041, garbled output
Posted: Mon May 20, 2013 1:07 pm
Hello, i recently bought serial 2041 for use with an Arduino, the manual online says it should have come with jumpers installed to indicate 19200, however i cannot see any jumpers installed on j0-j3, which should indicate 1200 baud if i'm reading this correctly. My problem comes when i try and send commands to the LCD, none of the commands work correctly and test send over the serial port, at 1200 baud, and in fact any other speed just shows up as what look like random ascii characters. i'm providing pictures of the j0-j3 pins to confirm the configured baud rate and pictures
the first picture is the back of the 2041 showing the jumper configuration for 232, 1200 baud(apparently), and the serial adapter.
the second is the startup screen without any input
the third is a sample sketch using a software serial port, at 1200 baud, which if working should clear the display and show 'hello world'
i've included the sketch below for reference as most of the sketches differ in the command codes they use and some that say they are for serial, are in fact for parallel.
I would really appreciate any help anyone can give me on this matter.
// Use the softwareserial library to create a new "soft" serial port
// for the display. This prevents display corruption when uploading code.
#include <SoftwareSerial.h>
// Attach the serial display's RX line to digital pin 2
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused)
void setup()
{
mySerial.begin(1200); // set up serial port for 1200 baud
delay(500); // wait for display to boot up
}
void loop()
{
mySerial.write(254); // move cursor to beginning of first line
mySerial.write(128);
mySerial.write(" "); // clear display
mySerial.write(" ");
mySerial.write(254); // move cursor to beginning of first line
mySerial.write(128);
mySerial.write("Hello, world!");
while(1); // wait forever
}
of the output from simple commands so you can get a better sense of the problem.the first picture is the back of the 2041 showing the jumper configuration for 232, 1200 baud(apparently), and the serial adapter.
the second is the startup screen without any input
the third is a sample sketch using a software serial port, at 1200 baud, which if working should clear the display and show 'hello world'
i've included the sketch below for reference as most of the sketches differ in the command codes they use and some that say they are for serial, are in fact for parallel.
I would really appreciate any help anyone can give me on this matter.
// Use the softwareserial library to create a new "soft" serial port
// for the display. This prevents display corruption when uploading code.
#include <SoftwareSerial.h>
// Attach the serial display's RX line to digital pin 2
SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused)
void setup()
{
mySerial.begin(1200); // set up serial port for 1200 baud
delay(500); // wait for display to boot up
}
void loop()
{
mySerial.write(254); // move cursor to beginning of first line
mySerial.write(128);
mySerial.write(" "); // clear display
mySerial.write(" ");
mySerial.write(254); // move cursor to beginning of first line
mySerial.write(128);
mySerial.write("Hello, world!");
while(1); // wait forever
}