Hi,
I am having problems with the baud rate control of a 2x16 Serial LCD.
The thing I don’t understand: is the baud rate saved in eeprom, or should we send the baud rate control command (at 9600) at boot time every time the device is powered on? I looked at the firmware but I don’t see anything related to baud rate control in the special_commands() function :-/
I set up the baud rate to 2400 bps, then ran the following code from an arduino:
#include <SoftwareSerial.h>
SoftwareSerial s(10, 2);
void setup() {
pinMode(2, OUTPUT);
s.begin(2400);
s.print(“Bah”);
}
void loop() {
}
It worked, but after a couple of power cycles (the SerLCD is powered by an arduino, powered by USB), it displayed garbled characters because the serLCD appeared to be reverted to 9600 bps. So it appears to be saved and not correctly restored, or not stored at all?
I got it working by sending the baud rate command every time the systems boots:
#include <SoftwareSerial.h>
SoftwareSerial s(10, 2);
void setup() {
pinMode(2, OUTPUT);
delay(200);
s.begin(9600);
s.print(124, BYTE);
s.print(11, BYTE);
delay(200);
s.begin(2400);
s.print(“Bah”);
}
void loop() {
}
Oddly enough, it doesn’t work without the delays (I can understand for the first one - the LCD might be still booting up, but I am not sure as for the second).
Has anybody faced this problem before? Is there a better solution?
Is there a way of permanently setting the default baud rate to avoid this problem?