Changing Serial LCD baud rate

06 Sep 2010 . Edited: 06 Sep 2010

I have a Sparkfun 2x16 serial LCD, and I was trying to change the baud rate over the weekend, but I couldn't get it to work.

I wondered if anyone's done it?

I'll try and knock up an example of what I think I should be doing, that fails when I'm back with the mbed & LCD.

 

Serial lcd(p9, p10);

lcd.printf("test");

lcd.putc(0x7C); // command char
lcd.putc(0x0E); // ctrl-N = 14400 baud from the SerLCD_V2_5 pdf

lcd.baud(14400); //change baud

lcd.printf("test");

 

What often happens is that "testte" gets displayed, which is odd, and sometimes I was playing I'd just get garbage ascii chars up.

I tried it with a wait(1) before the lcd.baud call, but that didn't seem to make a difference.

 

(here's a link to the spec sheet from Sparkfun http://www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDF )