Adjusting baud rate on Sparkfun SerLCD

Anyone know how to do this correctly from the arduino? I don’t understand how to send “k” to the LCD controller over serial.

Datasheet:

Thanks!!

I'm getting closer...

"control" keys have their own slot as ascii. see: http://www.pcguide.com/res/tablesASCII-c.html

I'm sending them to the LCD and still getting no change in the baud rate.

grr!

bump

They need to redo the manual for that thing.

I’ve just figured this out last week, after a lot of head → wall smashing. What they meant by say “k” or something is that you should hold the control key on your keyboard, and press “k” at the same time. Of course, you need a terminal program like hyperterminal to do this in, since you can’t use the control key in the arduino IDE serial console.

Hope this helps,

-Z-

not to dig up an old post but can someone clarify how exactly you do this? I need 4800 baud to work with my rf transmitter and receiver with the sparkfun serlcd connected to the receiver.

here is my code so far

#include <OneWire.h>

// DS18S20 Temperature chip i/o

OneWire ds(10);  // on pin 10

void setup(void) {
  // initialize inputs/outputs
  // start serial port
  Serial.begin(4800);
  Serial.print(0x7C, BYTE);   //backlight ON
  Serial.print(157, BYTE); 
  }


void loop(void) {
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];

  if ( !ds.search(addr)) {
      Serial.print("    ");
      ds.reset_search();
      return;
  }
/*
  Serial.print("R=");
  for( i = 0; i < 8; i++) {
    Serial.print(addr[i], HEX);
    Serial.print(" ");
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      Serial.print("CRC is not valid!\n");
      return;
  }

  if ( addr[0] != 0x28) {
      Serial.print("Device is not a DS18S20 family device.\n");
      return;
  }
  */

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);         // start conversion, with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
                   // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.select(addr);    
  ds.write(0xBE);         // Read Scratchpad

int rawtemp = (data[1]<<8) + data[0]; 

 
double tempc, tempf;
tempc = (double)rawtemp / 16;
tempf = (((tempc) * 1.8) + 32.0);  



 delay(100);

 Serial.print(0xFE, BYTE); 
 Serial.print(128, BYTE); 
 Serial.print("\n C= ");
 Serial.print(tempc,DEC);
 Serial.print(" degrees");
      
 delay(100);

 Serial.print(0xFE, BYTE);  
 Serial.print(192, BYTE); 
 Serial.print("\n F= ");
 Serial.print(tempf,DEC); 
 Serial.print(" degrees");
  
  
  for ( i = 0; i < 9; i++){           // we need 9 bytes
    data[i] = ds.read();
    OneWire::crc8( data, 8), HEX;
    }

 
}

sorry its ugly lol

Also just the C for celsius is flashing seemingly when it updates, any suggestions for eliminating this and keeping the timely updates?

Thanks,
Sean

According to the manual you send the command byte 124 (0x7c) and the control code
(Ctrl-m = 0x0d). Also I notice you start serial at 4800 while the default for the display according to the manual is 9600.

So i just add

  Serial.begin(9600);
  Serial.print(0x7C, BYTE);
  Serial.print(0x0d, BYTE);

Somewhere?

 Serial.print(0x7C, BYTE); //4800bps
 Serial.print(0xC, BYTE);

Is the code to set the lcd to 4800bps. How would I incorporate this if I want it to send the data from the arduino, over the 4800bps enabled wireless gap and to the serlcd.

Just for future reference: you can send CTRL-R through Arduino as well by using code 0x12.

I just screwed my SerLCD by uploading the code to Arduino while the LCD was still connected to TX (TX/RX pins are shared with USB connection). The LCD probably was set to a different speed and became unresponsive.

To reset it to default speed 9600 I just used:

void setup()
{
  Serial.begin(9600);
}

void loop()
{  
   Serial.print(0x12, BYTE);   //reset speed
   delay(100);
}

Then power cycle your SerLCD and it'll back to life :wink:

Surprisingly i am doing the exact same thing. Do you happen to be using this lcd:

I Got the 0x7C… code to turn my LCD to 4800bps but sadly i cant get your baud rate reset program to work.
My LCD may be stuck in 4800 bps FOREVER!
Is there different code like the 0x7C… code that will change it to 9600.

I understand why you need 0x7C but I wanted to know how you got from l to 0xC

technofun:

You have resurrected a thread that is more than a year old. The forum police will probably be after you. I think that the preferred technique is to start a new thread and reference the old one.

I understand why you need 0x7C but I wanted to know how you got from l to 0xC

Because 0x0C is the ASCII code for . That’s just the way it is - because that’s the way it was set up when the ASCII codes were formulated.

If you want more information on how to determine the relationship between the codes, and their Hex (and decimal, octal and binary) equivalents then follow the link to the Decimal - Binary - Octal - Hex - ASCII Conversion Chart at http://web.alfredstate.edu/weimandn. Scroll down below the chart itself and look at the information in “The first section:”.

Don

ok guys, i had trouble getting the lcd to work at 2400 baud and here is how i got it working

  1. first, what you need to understand is that you can set up the lcd display baud rate to 2400 baud or what ever having the arduino running at 9600 bps.

once this is done you dont need to include the codes for setting the lcd screen, in your sketch running at 2400bps.

  1. when you set up configuration for the lcd, you need to unplug the vcc and the tx wires.

  2. once the configuration is done, unplug the usb, and then put back the vcc and tx wires

  3. power up your arduino using a battery. ( so you run the sketch with the lcd display plugged in and running the lcd display sketch for the first time)

  4. then unplug everything, vcc and tx, then plug in usb, and upload your 2400 arduino baud sketch, without the lcd config codes.

  5. unplug usb, put back the vcc and tx, and run your sketch only with external power.

  6. if you get messed up screen display here is the code i made to do a total reset on the splash screen and default baud rate of the screen.

but make shure you unplug the lcd, when you upload it. once it is uploaded unplug usb, plug back the lcd vcc and tx, and use external power.

this is the code:
void setup(){
Serial.begin(9600);
Serial.print(0x7C, BYTE); //character 124 wich tells the lcd it's about to get configed
Serial.print( 0x09, BYTE); // splash screen reset - when you have the usb and tx and vc plugged in you get a conflict that is why you need this code
delay(500);
Serial.print(0x0C, BYTE); //4800 bps
Serial.print(0x12, BYTE); //total reset - will change for 9600 baud

}
void loop(){
//Serial.print(0x7C, BYTE); //special character

//reset character
Serial.print("total reset: ");
delay(3000);
}

then go back to step one and follow my instructions.

what happens is that if you run a low baud rate on the arduino, the void setup data is too slow to get transmitted to the lcd, so it cannot take the screen baud configuration,

You can only change the lcd baud rate while the lcd oot screen is running, past that time you cant send your config data to the lcd.

baude rates codes

Serial.print(0x0A, BYTE); //1200 bps
Serial.print(0x0B, BYTE); //2400 bps
Serial.print(0x0C, BYTE); //4800 bps
Serial.print(0x0D, BYTE); //9600 bps
Serial.print(0x0E, BYTE); //14400 bps
Serial.print(0x0F, BYTE); //19200 bps
Serial.print(0x0G, BYTE); //38400 bps

have a look at asci table
http://www.columbia.edu/kermit/ascii.html

also have a look at this :
http://forums.makezine.com/comments.php?DiscussionID=6436
:wink: